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
v-bacao-msft
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
v-bacao-msft
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
User Groups Public Preview

Join us for our User Group Public Preview!

Power Automate User Groups are coming! Make sure you’re among the first to know when user groups go live for public preview.

New Super Users

Meet the Power Automate Super Users!

Many congratulations to the Season 1 2021 Flownaut Crew!

Power Platform ISV STudio

Power Platform ISV Studio

ISV Studio is the go-to Power Platform destination for ISV’s to monitor & manage applications post-AppSource publish.

Users online (47,333)