cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
JacksonTeo
Frequent Visitor

How to get my child folder name?

Hi All, 

I try to upload child folder to my SharePoint document library and I would like to get the child folder name and send an email together with the child folder name. Unfortunately I use "Folder Path" in flows, but it only give me the main folder name, I cannot get the child folder name.

JacksonTeo_1-1625556089276.png

 

JacksonTeo_0-1625556011280.png

 

1 ACCEPTED SOLUTION

Accepted Solutions
v-bofeng-msft
Community Support
Community Support

Hi @JacksonTeo :

If your file is in a subfolder, then "Folder Path" contains the name of the subfolder. for example:

If the Full Path is

picc/SubFolder1/Document.docx

Then the folder Path should be

picc/SubFolder1/

If in this case you only want to get "SubFolder1",you could try this Expression:

split(triggerOutputs()?['body/{Path}'],'/')[sub(length(split(triggerOutputs()?['body/{Path}'],'/')),2)]

vbofengmsft_0-1625562698630.png

The Result

vbofengmsft_1-1625562730176.png

Best Regards,

Bof

 

View solution in original post

4 REPLIES 4
v-bofeng-msft
Community Support
Community Support

Hi @JacksonTeo :

If your file is in a subfolder, then "Folder Path" contains the name of the subfolder. for example:

If the Full Path is

picc/SubFolder1/Document.docx

Then the folder Path should be

picc/SubFolder1/

If in this case you only want to get "SubFolder1",you could try this Expression:

split(triggerOutputs()?['body/{Path}'],'/')[sub(length(split(triggerOutputs()?['body/{Path}'],'/')),2)]

vbofengmsft_0-1625562698630.png

The Result

vbofengmsft_1-1625562730176.png

Best Regards,

Bof

 

Hi @v-bofeng-msft ,

Thanks for your reply. I tried your method, unfortunately I still get the main folder name just without a "/" at the end.

I have do some test, if I upload entire subfolder(with files) in SharePoint document library, I will keep getting the Main folder name. But If I just upload a file into my sub folder, I will get the correct folder path (main folder/sub folder).

so my question is, is it unable to get sub folder name if I upload the entire sub folder from the SharePoint Document Library?

JacksonTeo_0-1625638312155.png

 

 

When I upload entire folder, i will only get this

JacksonTeo_1-1625638467750.png

 

 

Thanks for your support!

Regards,

Jackson

Hi @JacksonTeo :

Yes that is.

Best Regards,

Bof

JacksonTeo
Frequent Visitor

Hi @v-bofeng-msft ,

Finally I figure it out. Thanks for your help. I just change the compose Expression to:

split(triggerOutputs()?['body/{FullPath}'],'/')[sub(length(split(triggerOutputs()?['body/{FullPath}'],'/')),1)]
and it works!!
Appreciate your help!
 
Regards,
Jackson

Helpful resources

Announcements
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.

New Process Advisor Capabilities carousel.png

Read the blog for the latest news

Read the latest about new experiences and capabilities in the Power Automate product blog.

PA Survey Carousel Image.png

We want to hear from you!

If you are a small business ISV/Reseller, share your thoughts with our research team.

AI Builder AMA June 7th carousel (up on May 25th, take down June 8th) (1).png

'Ask Microsoft Anything' about AI Builder!

The AI Builder team invite you to ask questions and provide helpful answers at our next AMA.

Users online (1,469)