cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
schoden
Helper II
Helper II

When file is added to a folder that has multiple subfolders

Hi Community, 

Is there a way to find the particular subfolders NAME whenever a new file is added in it.  

 

I have a Parent Folder  and Many subfolders( A, B, C, D) under it in sharepoint  

folder.jpg

 

 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
v-xiaochen-msft
Community Support
Community Support

Hi @schoden ,

 

I did a test for you.

vxiaochenmsft_0-1642044113064.png

vxiaochenmsft_1-1642044121235.png

vxiaochenmsft_2-1642044154982.png

split(base64ToString(triggerOutputs()?['headers/x-ms-file-path-encoded']),'/')[1]
 
replace(replace(base64ToString(triggerOutputs()?['headers/x-ms-file-path-encoded'])  , concat('/', base64ToString(triggerOutputs()?['headers/x-ms-file-name-encoded'])),''),concat('/',split(base64ToString(triggerOutputs()?['headers/x-ms-file-path-encoded']),'/')[1]),'')
 
ContentType eq 'Folder'
 
vxiaochenmsft_3-1642044206733.png

 

Best Regards,

Wearsky

 

 

 

 

View solution in original post

4 REPLIES 4
tom_riha
Super User
Super User

Hello @schoden ,

check the available dynamic contents provided by the trigger, there should be 'Folder Path' among them.



[ If I have answered your question, please Accept the post as a solution. ]
[ If you like my response, please give it a Thumbs Up. ]

[ I also blog about Power Automate solutions even for non-IT people. ]

@tom_riha 

The dynamic contents doesnt show Folder Name option rather it only file details. test.JPG

v-xiaochen-msft
Community Support
Community Support

Hi @schoden ,

 

I did a test for you.

vxiaochenmsft_0-1642044113064.png

vxiaochenmsft_1-1642044121235.png

vxiaochenmsft_2-1642044154982.png

split(base64ToString(triggerOutputs()?['headers/x-ms-file-path-encoded']),'/')[1]
 
replace(replace(base64ToString(triggerOutputs()?['headers/x-ms-file-path-encoded'])  , concat('/', base64ToString(triggerOutputs()?['headers/x-ms-file-name-encoded'])),''),concat('/',split(base64ToString(triggerOutputs()?['headers/x-ms-file-path-encoded']),'/')[1]),'')
 
ContentType eq 'Folder'
 
vxiaochenmsft_3-1642044206733.png

 

Best Regards,

Wearsky

 

 

 

 

Thank You So much 

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

MPA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

Power Automate Designer Feedback_carousel.jpg

Help make Flow Design easier

Are you new to designing flows? What is your biggest struggle with Power Automate Designer? Help us make it more user friendly!

Users online (3,734)