In Power Automate, to return a uniform resource identifier (URI) encoded version for a string by replacing URL-unsafe characters with escape characters we can use either encodeUriComponent or uriComponent functions in expressions.
Login to the required Power Apps environment using URL make.powerapps.com by providing user name and password and click on Flows on the left hand side as shown in the below figure.
After Step 1, click on New Flow and then Instant Flow and under option Choose how to trigger the flow select Manually tigger a flow and click on Create button as shown in the below figure.
After Step 2, provide name as Encode Uri for the flow and then select an operation with name Initialize variable Action as shown in the below figure.
After Step 3, Initialize variable is used to hold url that needs to be encoded, so provide the name as Uri and Type as String and Value as https://venkatasubbaraopolisetty.com/ and click on New Step as shown in the below figure.
After Step 4, select an Action Compose under Choose an operation as shown in the below figure.
After Step 5, under Inputs click on Expression and type
here encodeUriComponent() is the function and variables (‘Uri’) is the variable value which we received from step 4 as shown in the below figure.
After Step 6, Click on Save button and click on Test as shown in the below figure.
After Step 7, Click on Manually and Click on Test as shown in the below figure.
After Step 8, Click on Run Flow and you could see below screen and click on Done as shown in the below figure.
After Step 9, input initialize variable with Uri turned to encoded uri which is encoded version for a string by replacing URL-unsafe characters with escape characters as shown in the below figure.
After Step 10, we can also use another recommended function uriComponent by Microsoft by providing under compose operation under expression to encode
which will encode to equivalent encoded version for a string by replacing URL-unsafe characters with escape characters and save and Test (Repeat Steps 8 and 9)and can see same expected result as shown in the below figure.
After Step 11, one can find both Power Automate functions provided same result as shown in the below figure.
- Make sure to save and run the flow whenever you try expressions.
- MS documentation is found at https://docs.microsoft.com/en-us/azure/logic-apps/workflow-definition-language-functions-reference#uriComponent
- As an example my website is taken into consideration to provide as variable in Step 4, you can provide any other value of your choice.
5 thoughts on “Power Automate Fundamentals # 2: Usage of Encode Uri in Power Automate”
Thanks for sharing! Is it possible to convert a text within a variable to any hash format type?
This is the default function provided by product to do encoding. To your question we may have to write custom code to achieve this
Pingback: Rewind July 2021 – Common Man Tips for Power Platform, Dynamics CRM,Azure
Pingback: Rewind July 2021 - Microsoft Dynamics CRM Community
Thank you a lot for providing individuals with an exceptionally terrific opportunity to check tips from this web site. It’s usually very good and stuffed with fun for me and my office fellow workers to visit your site at the very least 3 times every week to read the fresh guides you have. And lastly, I’m just certainly impressed with your wonderful guidelines served by you. Selected 3 facts in this post are rather the very best I have ever had.