cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
j3-crre
Level: Powered On

Path from File Path

I am building a flow where I want the output path to be the same as the input but I believe it is failing because the only variable I have is the "File Path" dynamic content variable which is the full path to the file as well as the file name.

 

Basically I am trying to figure out if there is an Azure/Flow equivalent to dirname() so that a full file path like:

 

  • /my/path/myfile.tmp

 

becomes

 

  • /my/path

 

Is there a function like dirname() that will remove the end of the path back to the next / or is folder path information passed in the file metadata and how is it accessed?

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support Team
Community Support Team

Re: Path from File Path

Hi j3-crre,

 

If your path is static, I would suggest you use workflow definition language substring to return a subset of characters from a string.


For example, this function “substring('somevalue-abc-somevalue',10,3)” returns “abc”.


More details about the function, please check it at here:
https://docs.microsoft.com/en-us/azure/logic-apps/logic-apps-workflow-definition-language


Please have a try with it and feel free reply if you need more help.

 

Best regards,
Mabel Mao

 

Community Support Team _ Mabel Mao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

1 REPLY 1
Community Support Team
Community Support Team

Re: Path from File Path

Hi j3-crre,

 

If your path is static, I would suggest you use workflow definition language substring to return a subset of characters from a string.


For example, this function “substring('somevalue-abc-somevalue',10,3)” returns “abc”.


More details about the function, please check it at here:
https://docs.microsoft.com/en-us/azure/logic-apps/logic-apps-workflow-definition-language


Please have a try with it and feel free reply if you need more help.

 

Best regards,
Mabel Mao

 

Community Support Team _ Mabel Mao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Helpful resources

Announcements
firstImage

Power Platform Online Conference

Join us for the first ever Power Platform Online Conference!

firstImage

Incoming: New and improved badges!

Look out for new contribution recognition badges coming SOON!

firstImage

New & Improved Power Automate Community Cookbook

We've updated and improved the layout and uploading format of the Power Automate Cookbook!

thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

seventhimage

Webinars & Video Gallery

Watch & learn from the Power Automate Community Video Gallery!

Top Solution Authors
Top Kudoed Authors
Users online (5,060)