web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Split root folder from...
Power Apps
Answered

Split root folder from Item Full path

(0) ShareShare
ReportReport
Posted on by 40

Hi I am currently using (with some tweaks) Matthew Devaneys guide to folder navigation Power Apps Navigating Folders & Subfolders In A SharePoint Document Library  

 

However what I am trying to do is then take the selected document, and add it into a collection which is connected to a data table

Collect(
Spec_Sheets_Collect,
{
Location: ThisItem.'Folder path',
Filename: ThisItem.Name,
Prods: varFolderPathCurrent
}
)
)

 What I want to do though is display a specific product type. This is held as the root folder within the SharePoint library so in the below location example - Spec Sheets is the library, equipment is the text I want to return in the prods field. There are a lot more product groups and some of the groups can have multiple sub folders in, however when i select a product I always want to bring back that root folder.

 

in the below example;

the top item is the full path of the folder

the second is when i tried to split it to get the part I wanted  

the third is the folder path variable which is used elsewhere on the page.

cammc_0-1661954375341.png

 

My assumption would be that it should be easy to split this from the file path but I'm not sure how to format it to it either avoids being read as an object, or to have it set as a text value.

 

@mdevaney  sorry for butchering your code on this

Categories:
  • Verified answer
    cammc Profile Picture
    40 on at
    Trim(
     Last(
     FirstN(
     Split(
     ThisItem.'Folder path',
     "/"
     ),
     2
     )
     ).Result
     )

    Sorted it with the above.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 345 Super User 2026 Season 2

#2
M Bilal Khan Profile Picture

M Bilal Khan 312

#3
Mohsin Ali Profile Picture

Mohsin Ali 252

Last 30 days Overall leaderboard