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

sharepoint list folder fail

I have a flow first moving a SharePoint folder (/InconSystemTemp/Contractor Invoice/90) to another folder (/InconSystemTemp/Contractor Invoice/Rubbish/90) and it works fine then I use List Folder on the destination folder but with error below:

"message""The response is not in a JSON format.",
"innerError""The resource you are looking for has been removed, had its name changed, or is temporarily unavailable."
list1.png
 
I create another flow to test List Folder.
If I type the path in the File Identifier, it shows the same error.
If I click the left folder picker button to select the path, then it runs OK.
list2.png
 
1 ACCEPTED SOLUTION

Accepted Solutions

Hi!

THe problem is probably you need to use character /. Anyway, I tried by adding the Folder from the dynamic content menu, please see the successful result Flow_FolderFromDropDownVsDynamicContent.png

So, you can add an auxiliary 'Compose' action block, build folder path inside with a combination of text and the dynamic content 'Sharepoint list item ID'. It probably works also without the auxiliary 'Compose', but I haven't tested this second approach

Hope this helps



Each time you click on any of our inspiring answers 'Thumb up' icon...
...an ewok scapes from the stormtroopers.

Be grateful, Thumbs up! Save the Galaxy for free!


Escribo sobre Power Automate en:
https://medium.com/anyone-can-automate/

Proud to be a Flownaut!



View solution in original post

17 REPLIES 17
EricaBao
Community Support
Community Support

Hi @JoeAu 

 

This is due to the Folder Identifier. The folder in SharePoint is identified by GUID instead of relative path. In your flow, the ID could be dynamic depending on the previous action Move Folder, foe example as below.

Annotation 2020-06-03 140808.png

 

The reason why it works when you select the path via clicking the left folder picker button, is because that is a mapping implemented in the Action, the actual identifier used is also the Folder GUID.

 

 

 

 

 

 

 

Thanks EricaBao.

 

I change the flow as below, it gets the File Identifier.

list3.png

 

But when I pass it to Get File Properties, it shows error.

list4.png

Hi!

It seems the error comes from the fact you are assigning 'File Identifier' to 'Get file -properties only-', right?. In such case you need to assign the file ID instead

I also assume your 'Apply to each 2' iterates all through the results provided by 'List folder' right?

Hope this helps



Each time you click on any of our inspiring answers 'Thumb up' icon...
...an ewok scapes from the stormtroopers.

Be grateful, Thumbs up! Save the Galaxy for free!


Escribo sobre Power Automate en:
https://medium.com/anyone-can-automate/

Proud to be a Flownaut!



Yes. 'Apply to each 2' iterates all through the results provided by 'List folder'

'Apply to each 2' will copy files from 'List folder' to OneDrive.

but, how can I specify the file id? there is no file id i can select.

list5.png

Hi!

Did you consider to replace 'List folder' and use 'Get files -properties only-' instead? You need to select the target Library, but optionally you can specify the subfolder also by means of 'Limit entries to folder'

With 'Get files -properties only-' you can obtain the File ID

Hope this hleps



Each time you click on any of our inspiring answers 'Thumb up' icon...
...an ewok scapes from the stormtroopers.

Be grateful, Thumbs up! Save the Galaxy for free!


Escribo sobre Power Automate en:
https://medium.com/anyone-can-automate/

Proud to be a Flownaut!



abm
Super User
Super User

Hi @JoeAu 

 

It's a long thread 🙂

 

The reason for the failure for 404 is when you manually put the path with slash there is an encoding issue which returns as an invalid path

 

image.png

 

If you manually typing path replace the / with %252f

 

%252fInconSystemTemp%252fContractor Invoice%252fRUBBISH

 

Here are my findings:

 

Below is the error I replicated.

 

image.png

 

Replaced slash with %252f

 

image.png

 

Thanks

 

 



Did I answer your question? Mark my post as a solution!

If you liked my response, please consider giving it a thumbs up


Proud to be a Flownaut!

Learn more from my blog
Power Automate Video Tutorials
abm
Super User
Super User

Hi @JoeAu 

 

Another further update about encoding

 

You could replace slash with %2f or %252f

 

I am bit confused but both should work. 

 

Thanks



Did I answer your question? Mark my post as a solution!

If you liked my response, please consider giving it a thumbs up


Proud to be a Flownaut!

Learn more from my blog
Power Automate Video Tutorials
abm
Super User
Super User

Hi @JoeAu 

 

The best fix is use the expression 

 

encodeUriComponent('/aj/z')
 
This converts to 
 
%2Faj%2Fz
 
Here it is
 
image.png
 
Thanks


Did I answer your question? Mark my post as a solution!

If you liked my response, please consider giving it a thumbs up


Proud to be a Flownaut!

Learn more from my blog
Power Automate Video Tutorials

Thank you for your reply and let me learn more.😀

I use the %252f instead of /

The 'List folder' works and return as below:

"Id""%252fInconSystemTemp%252fContractor%2bInvoice%252fRUBBISH%252f90%252fJOB123-IA0001-INVOICE(23456)-UOG%2bLimited-suit-grey.jpg",
"Name""JOB123-IA0001-INVOICE(23456)-UOG Limited-suit-grey.jpg",
"DisplayName""JOB123-IA0001-INVOICE(23456)-UOG Limited-suit-grey.jpg",
"Path""/InconSystemTemp/Contractor Invoice/RUBBISH/90/JOB123-IA0001-INVOICE(23456)-UOG Limited-suit-grey.jpg",
"LastModified""2020-06-03T00:51:13Z",
"Size"5779,
"MediaType""image/jpeg",
"IsFolder"false,
"ETag""\"{DA3639BD-40C6-4C89-A2B0-9FD9B58B15DC},1\"",
"FileLocator""dataset=aHR0cHM6Ly9pbmNvbmhrLnNoYXJlcG9pbnQuY29tL3RlYW1zL2FkbWlu,id=JTI1MmZJbmNvblN5c3RlbVRlbXAlMjUyZkNvbnRyYWN0b3IlMmJJbnZvaWNlJTI1MmZSVUJCSVNIJTI1MmY5MCUyNTJmSk9CMTIzLUlBMDAwMS1JTlZPSUNFKDIzNDU2KS1VT0clMmJMaW1pdGVkLXN1aXQtZ3JleS5qcGc=",
"LastModifiedBy"null
 
Then I pass the 'Id' to 'Get file properties' as I want to copy the file content to OneDrive.
But it fails with error
list6.png
But, I see that Id is correct, the same as I get from 'List folder'
Id: %252fInconSystemTemp%252fContractor%2bInvoice%252fRUBBISH%252f90%252fJOB123-IA0001-INVOICE(23456)-UOG%2bLimited-suit-grey.jpg
 

Hi!

Did you consider to replace 'List folder' and use 'Get files -properties only-' instead? Once you add 'Get files -propertiesonly-' you need to select the target Library, but optionally you can specify the subfolder also by means of 'Limit entries to folder'

'Get files -properties only-' provides File ID and the rest of the file properties

Hope this helps



Each time you click on any of our inspiring answers 'Thumb up' icon...
...an ewok scapes from the stormtroopers.

Be grateful, Thumbs up! Save the Galaxy for free!


Escribo sobre Power Automate en:
https://medium.com/anyone-can-automate/

Proud to be a Flownaut!



Thanks 

I take your advice to use 'Get file (properties only)'

if I use the folder picker button to select the path, then it works.

list7.png

The folder '90' is varied. Because it is actually the ID no. of the SharePoint List.

So, I try to set the 'Limit Entries to Folder' as below

list8.png

But it show error that : Folder Not Found

 

Hi!

THe problem is probably you need to use character /. Anyway, I tried by adding the Folder from the dynamic content menu, please see the successful result Flow_FolderFromDropDownVsDynamicContent.png

So, you can add an auxiliary 'Compose' action block, build folder path inside with a combination of text and the dynamic content 'Sharepoint list item ID'. It probably works also without the auxiliary 'Compose', but I haven't tested this second approach

Hope this helps



Each time you click on any of our inspiring answers 'Thumb up' icon...
...an ewok scapes from the stormtroopers.

Be grateful, Thumbs up! Save the Galaxy for free!


Escribo sobre Power Automate en:
https://medium.com/anyone-can-automate/

Proud to be a Flownaut!



Thanks efialttes 

 

Hi!

Did you solve your original issue?

CONGRATS!

Now, on your new question, this is an old thread covering 'DElete folder' logic, not sure if there will be a more elegant approach since then

https://powerusers.microsoft.com/t5/Building-Flows/Delete-Folder-in-SharePoint-via-HTTP-Action/td-p/...

 

Next steps? My humble suggestion:

1.-Mark this topic as "Solved" by clicking "Accept as a solution". THis way others facing a similar problem can find a solution faster. Please also note you can even select several responses as solution, even from different community members!

 

Flow_AcceptSolution.png

 

2.- Open a new thread for your next question, following the policy: 'One Question, one post'. This way you have more chances to attrack attention for superusers that are seeking for unanswered topics. So if a more elegant approach exist, you have more chances to get appropriate feedback

3.- (OPTIONAL) Click on 'Thumbs up' in any answer you found valuable... or even in all of them 😉

 
 

Flow_thumbsUp.png

 

Even though this 3rd step is OPTIONAL, please remember it is the cheapest, easiest way to say thanks to somebody that spent its time simply trying to help. And just between you and me, everytime an inspiring answer receive a kudo in this community, an ewok escapes from The Emperor menace 

 

Thanx for your help making this community great!

 



Each time you click on any of our inspiring answers 'Thumb up' icon...
...an ewok scapes from the stormtroopers.

Be grateful, Thumbs up! Save the Galaxy for free!


Escribo sobre Power Automate en:
https://medium.com/anyone-can-automate/

Proud to be a Flownaut!



auyiucho
Helper I
Helper I

i want to mark as solution.

but the Solution button does not here.

list9.png

@auyiucho

I guess you are using both @auyiucho and @juju accounts to post in this thread, right? If so, @JoeAu account is the right one to mark this thread as solution since it is the account used to open the thread.

Thanx!



Each time you click on any of our inspiring answers 'Thumb up' icon...
...an ewok scapes from the stormtroopers.

Be grateful, Thumbs up! Save the Galaxy for free!


Escribo sobre Power Automate en:
https://medium.com/anyone-can-automate/

Proud to be a Flownaut!



DiogoMachado
Regular Visitor

So, I've been smashing my head on this issue the entire morning. I didn't understand the accepted answer on this post, so maybe this will help someone.

First, I looked at the Raw Inputs after a succesful run (where you input the folder path from the button) and an unsuccessful run (where the input is from a Compose for example)

DiogoMachado_0-1646828397108.png

 

And here are the results:

  • Success

DiogoMachado_2-1646828686155.png

  • Failure

DiogoMachado_3-1646828724194.png

 

As you can see, the "/" character gets encoded. The frustrating part is that the encoding is only visible if you go to Show Raw Inputs, and not on the preview on power automate.

Another strange thing is that it encodes to "%252f", but we can ignore that: https://drupal.stackexchange.com/questions/10736/252f-in-the-url

 

To fix this, we can use the expression "encodeUriComponent" and this will solve the issue. You can put it directly on the action, or on a compose, doesn't matter: https://docs.microsoft.com/en-us/azure/logic-apps/workflow-definition-language-functions-reference#e...

DiogoMachado_4-1646829317836.png

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.

May UG Leader Call Carousel 768x460.png

June User Group Leader Call

Join us on June 28 for our monthly User Group leader call!

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!

Top Solution Authors
Top Kudoed Authors
Users online (3,233)