cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
MichaelHutchens
Level: Powered On

Setting folder path from file in document library as a variable

Hi everyone,

 

I'm working with a SharePoint document library that has three levels of folders and subfolders. I need to have a flow, triggered on file creation or file modification in the library, that captures each file URL, splits each folder level in the URL out into variables, and applies each variable to 4 string columns. Example screeshot below:

 

Untitled1.png

 

I'm hoping that I've provided enough information here, and that there is an easy solution to this? Any help would be really appreciated 🙂

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support Team
Community Support Team

Re: Setting folder path from file in document library as a variable

Hi @MichaelHutchens ,

 

You could use split() function to get the folder name.

split(triggerBody()?['{Path}'],'/')
outputs('FolderPath')[0]
outputs('FolderPath')[1]
outputs('FolderPath')[2]

Image reference:

12.PNG

 

Best Regards,

Community Support Team _ Barry
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

2 REPLIES 2
Community Support Team
Community Support Team

Re: Setting folder path from file in document library as a variable

Hi @MichaelHutchens ,

 

You could use split() function to get the folder name.

split(triggerBody()?['{Path}'],'/')
outputs('FolderPath')[0]
outputs('FolderPath')[1]
outputs('FolderPath')[2]

Image reference:

12.PNG

 

Best Regards,

Community Support Team _ Barry
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

MichaelHutchens
Level: Powered On

Re: Setting folder path from file in document library as a variable

Perfect @v-bacao-msft , that's exactly what I need. Thank you 🙂

Helpful resources

Announcements
thirdimage

Power Automate Community User Group Member Badge

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

firstImage

Incoming: New and improved badges!

We've given our badges an overhaul and also added some brand new ones!

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

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 Kudoed Authors (Last 30 Days)
Users online (5,040)