cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anonymous
Not applicable

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
Community Support

Hi @Anonymous ,

 

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
Community Support

Hi @Anonymous ,

 

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

Anonymous
Not applicable

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

Helpful resources

Announcements
New Super Users

Meet the Power Automate Super Users!

Many congratulations to the Season 1 2021 Flownaut Crew!

New Badges

New Solution Badges!

Check out our new profile badges recognizing authored solutions!

MPA Community Blog

Power Automate Community Blog

Check out the community blog page where you can find valuable learning material from community and product team members!

Users online (98,008)