I am new to Power Automate, and this is a simple thing I know but need help with,
I am building a flow that gets all files under a Document Library and returns the values in in an HTML Table,
The result is shown like this:
Document Name Review Date Folder Name Folder
01.FM.0215 - Doc1 v00 | 29/08/2023 | HR/Process /Assc Forms/ |
I want to split the text in the folder name and show only the last subfolder which in the above case should be assc forms
When I am trying split expression there is no option to split the Folder Full path property
please assist
Appreciate your help and advice,
Worked very well as required , Thank you very much @Expiscornovus
Hi @Oelshamy,
You can use a skip and a couple of split functions to retrieve this from the {Path} property of the file.
Below is an example of that approach:
skip(split(item()?['{Path}'], '/'),sub(length(split(item()?['{Path}'], '/')), 2))[0]
Alternatively, you could look into using the parentuniqueid of the item. However, this does require a couple of HTTP requests. I don't know if that is useful in your scenario. Have a look at my blog about this:
https://www.expiscornovus.com/2022/06/18/retrieve-parent-folder-name-of-item/
Michael E. Gernaey
497
Super User 2025 Season 2
David_MA
436
Super User 2025 Season 2
Riyaz_riz11
244
Super User 2025 Season 2