Usage Of uriPath Function In Power Automate

Introduction

In Power Automate, one common scenario is to get the path after the host which will allow configuring URLs easily between environments automatically. uriPath function is used to extract path after host in power automate.

Step 1

Login to the required Power Apps environment using URL make.powerapps.com by providing the user name and password and click on Flows on the left-hand side as shown in the below figure.

Usage of uriPath Function in Power Automate

Step 2

After step 1, click on New Flow and select instant cloud flow and provide the trigger as Manually trigger a flow and click on Create as shown in the below figure.

Usage of uriPath Function in Power Automate

Step 3

After step 2, name the flow as uriPath to hold the Website URL we must click on + New Step and choose to compose operation and provide the following step name as Compose - Website Address.

Inputs - https://venkatasubbaraopolisetty.com/2021/08/20/power-automate-fundamentals-8-usage-of-urihost-function-in-power-automate/

And click on save as shown in the below figure.

Usage of uriPath Function in Power Automate

Step 4

After step 3, click on + New Step and choose to compose operation and provide the following step name as Compose – uriPath Function and click on Inputs and in the down window click on Expression tab and see for uriPath.

uriPath (uri: string)

and provide value as,

uriPath(outputs('Compose_-_Web_Site_Address'))

And click on ok/Update as shown in the below figure.

Usage of uriPath Function in Power Automate

Step 5

After step 4, test and run the flow and see the desired result the path after host returned as shown in the below figure.

Usage of uriPath Function in Power Automate

Note

  1. Make sure to save and run the flow whenever you try expressions.
  2. MS documentation is found here.
  3. If the path doesn't have a value, return the "/" character.
  4. Also, this function will return the path excluding query values.
  5. If both path and query values are required, then use uriPathAndQuery.

Conclusion

In this way, we can extract the path that is present after the hostname in the Power Automate flow.