Did you know that you can use Power Automate connectors in Power Apps?
This means you can consume Encodian Flowr actions (and any other Power Automate Connectors) within your apps without needing to call a separate Power Automate flow! This approach allows your Power Apps to run much faster as the connecter actions are executed within the app itself rather than in an external flow.
Contents
We are using Encodian Flowr connectors for this demo, but the same principles apply to using Power Automate connectors within PowerApps.
Encodian Flowr consists of different connectors, each with different associated actions. You can add any Encodian Flowr connector to the app the same way you would add any other data source.
To add an Encodian Flowr connector:
Once the connector has been added, it will appear in your list of data sources.
Using an action is classified as a behaviour function (similar to Navigate and Reset). This means they must be used in the following controls:
If you want to display the results of an action, you can store the result value in a variable.
To use an added Flowr connector, start typing out the connector’s name. All of the available actions will appear in the suggestion pop-up.
Once you have selected the action, type ‘(‘ to see the inputs required for the action to run. The inputs are the same as what you provide within Power Automate. If unsure, you can always check the documentation for that action!
If your input has choices, these will appear for you to select from.
To set the result of an action in a variable, your formula will follow this layout:
Set(nameOfVariable, encodianConnector.Action(inputs).Output)
You can then display the action’s outputs in the app. Continuing with the Image flip example, I will set the Image property as the result variable. This means that when the result variable is populated with the flipped image, it will display in my image control.
I have created a Password Manager Power App to showcase how you might want to use Flowr within your Power Apps. The app allows you to generate new passwords, save them to Dataverse, and view them within the app. The solution uses three Flowr actions, all from the Encodian – Utilities connector:
I have created a Dataverse table called Passwords.
Data saved to the Password column will be encrypted before it is stored in Dataverse to ensure it is secure. It will then be decrypted when viewed in the Power App.
To use encryption and decryption, you need an encryption key. This key acts like a password, allowing you to encrypt the data and decrypt it so you can view it again. I am saving my encryption key in a variable called encryptionKey in the app’s OnStart property.
Set(encryptionKey, "putEncryptionKeyHere")
The app has two main pages, one for creating new passwords and another for viewing passwords.
The buttons on the home page both use the Navigate function to move to their respective pages.
Navigate('Password Generator') Navigate('View Passwords')
Let’s look at the ‘Create New Password’ page first.
We are using Encodian Flow’s Generate Password action from the Encodian – Utilities connector.
These are all the available inputs to the action. I have created these as options on the ‘Password Generator’ screen for the user to choose from. The ‘Length’ text inputbox is set to number format, with a maximum length of 16.
The ‘Generate Password’ button calls the Utility – Generate Password Flowr action. I am using this formula in the OnSelect property:
Set(result,'Encodian-Utilities'.UtilitiesGeneratePassword(lengthTxt.Text,{includeLowerCase:lowerCheck.Value, includeUpperCase:upperCheck.Value,includeNumbers:numbersCheck.Value,includeSymbols:symbolCheck.Value}).result)
The formula stores the generated password in a variable called result. I can then set the default value of the password text input box as the result variable, so as soon as a password is saved to the variable, it will appear in the box.
The Reset icon next to the password text input box resets all the password inputs and returns the result variable to blank.
Reset(passwordTxt); Set(result,""); Reset(lengthTxt); Reset(upperCheck); Reset(lowerCheck); Reset(numbersCheck); Reset(symbolCheck)
Even though we now have a generated password, the Save icon is still disabled. This is because we need to provide the account name so that you know what each password is for when viewing your passwords. This formula is used in the DisplayMode property of the icon to manage this:
If(IsBlank(accountTxt.Text) || IsBlank(result), DisplayMode.Disabled, DisplayMode.Edit)
The ‘Save’ icon saves the password and the account name to Dataverse using a Patch function. Within the Patch, we call another Flowr action Utility – AES Encryption. This will encrypt the data before saving it to Dataverse, making it secure. The following formula is used in the OnSelect property of the Save icon:
Patch(Passwords,Defaults(Passwords),{'Account Name':accountTxt.Text,Password:'Encodian-Utilities'.UtilitiesAesEncryption(passwordTxt.Text,"BASE64",encryptionKey,"ECB").result});
Select(home)
The AES Encryption action inputs are:
After saving the password, I select the Home icon to take me back to the Home Screen. It will also reset all the fields on the page. The OnSelect property of the Home icon is:
Navigate('Home Screen'); Reset(passwordTxt); Reset(lengthTxt); Reset(upperCheck); Reset(lowerCheck); Reset(numbersCheck); Reset(symbolCheck); Set(result,""); Reset(accountTxt)
Let’s save the password we have just generated and see what it looks like in Dataverse.
As we can see, the password has been encrypted, but the actual password has not been saved to Dataverse.
Let’s have a look at the ‘View Passwords’ page.
The OnVisible property of the page refreshes the Passwords table, so the gallery has the most up to date data.
Refresh(Passwords)
The gallery is filtered to only show passwords created for the current user of the app. The gallery only displays the account name saved to Dataverse.
Filter(Passwords, 'Created By'.'Azure AD Object ID' = User().EntraObjectId)
The View icon in the gallery calls the Flowr Utility – AES Decryption action in the OnSelect property to decrypt the saved password in Dataverse, bringing the actual password value back to the Power App.
Select(Parent); Set(password,'Encodian-Utilities'.UtilitiesAesDecryption(ThisItem.Password,"BASE64",encryptionKey,"ECB").result)
The decrypted password is being saved to a variable called password. This variable is set to the Default value of the text input box, so as soon as the decryption is complete the password will be visible on the screen.
Watch Sophie’s companion video on YouTube:
Save time with 185+ actions across 9 connectors
Sign up for your free 30-day trial; no cards, catches, or contracts.
Don’t struggle! Try out our Premium Support packages today.
Technology Evangelist