cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
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
Highlighted
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
Highlighted
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

Highlighted
Anonymous
Not applicable

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

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.

Top Solution Authors
Top Kudoed Authors
Users online (12,827)