Introduction

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
Also, to return a normal URL from URL Safe Characters embedded encoded URI decodeUriComponent function is used
Step 1
Login to the required Power Automate environment using URL make.powerautomate.com by providing the user name and password and click on Create on the left-hand side as shown in the below figure and after chose the Instant Cloud Flow
Step 2
After step 1, click on  the trigger as Manually trigger a flow, and Give the Flow Name Then click on Create as shown in the figure below.
Step 3
After Step 2, Take the Initialize variable and Initialize variable is used to hold the URL that needs to be encoded, so provide the name as URL and Type as String and Value as https://testforencodeanddecode.com/ 
Step 4
After step 3, select an Action Compose
Step 5
After step 4, under Inputs  click on Expression and type, encodeUriComponent(variables(‘URL’)) (or) uriComponent(variables(‘Uri’))
Here encodeUriComponent() is the function and variables (‘Uri’) is the variable value which we received from step 3 as shown in the below figure.
Step 6
After step 5, we need to take another compose set the “Encode function” value into “Set Encode Value” as show in the bellow figure.
Step7
After step 6, take compose operation and name it as Compose – DecodeUriComponent and then under Inputs navigate to Expression Tab and then provide bellow code
Syntax:
decodeUriComponent(outputs(‘Set_Encode_value’))
Step 8
After step 7, Click on Test -> Test Flow (Manually) and then click on Save & Test as shown in the below figure,

After flow is success run the outputs is given bellow

For any Help or Queries Contact us on info@crmonce.com or +918096556344