cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Advocate III
Advocate III

How to get folder ID in SharePoint

Hello,

 

I am trying to get a folder ID to use List Folder, but to do that I need the ID. When I use Get File Metadata Using Path I get an error that the folder doesn't exist. I am guessing because that REST call expects a file not a folder. Is there a way to get a Folder ID with the path name?

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
New Member

Re: How to get folder ID in SharePoint

Hi,

 

I've been strugling with the same problem for some hours and found a solution to make dynamic url folder string that I can use as a parameter to the "List Folder" block.

 

This was my solution:

replace(replace(body('Get_item')?['{Path}'],'/','%252f'),' ','%2b')

 

The "body('Get_item')?['{Path}']" part of the line is the variable.

 

This worked for me 😉

View solution in original post

6 REPLIES 6
Highlighted
Community Support
Community Support

Re: How to get folder ID in SharePoint

Hi @stvcdms,

 

If you know the actual folder name, then we may use the following way to get the corresponding Folder ID:

22.PNG

Regards,

Michael

Community Support Team _ Michael Shao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Highlighted
Advocate III
Advocate III

Re: How to get folder ID in SharePoint

Thanks, this is party helpful. Though after playing with this more, it turns out List Folder isn't useful... I mean it's getting pretty frustrating now, but List Folder doesn't appear to work properly with subsites.

 

You can't provide List Folder with dynamic site address parameters or build the URL from the folder parameter...

Highlighted
New Member

Re: How to get folder ID in SharePoint

Hi,

 

I've been strugling with the same problem for some hours and found a solution to make dynamic url folder string that I can use as a parameter to the "List Folder" block.

 

This was my solution:

replace(replace(body('Get_item')?['{Path}'],'/','%252f'),' ','%2b')

 

The "body('Get_item')?['{Path}']" part of the line is the variable.

 

This worked for me 😉

View solution in original post

Highlighted
Advocate III
Advocate III

Re: How to get folder ID in SharePoint

Thanks for this. I ended up doing something similiar, but with hard coding, your formula is most useful!

Highlighted
New Member

Re: How to get folder ID in SharePoint

BTW found out the since I’m building up a folderpath by both dynamic and static data it was best to store it as a variable and run a CONCAT to combine.

Wasn’t able to use REPLACE inside the CONCAT 😉
Highlighted
New Member

Re: How to get folder ID in SharePoint

Hi I know this is an old thread, but could you please provide guidance as to how you used the provided variable within the flow? (Screenshots like the original reply would be great!

 

Helpful resources

Announcements
FirstImage

Microsoft Ignite 2020

Check out the announcement of Power Platform content at Microsoft Ignite!

thirdImage

Experience what's new for Power Automate

Join us for an in-depth look at the new Power Automate features and capabilities at the free Microsoft Business Applications Launch Event.

firstImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Users online (4,767)