Hi,
I have a problem with my Flow, i get the following error message: NotFound - The response is not in a JSON format.
See screenshot below:
Flow Error
Even though the file does exists in the document library.
Can someone tell me what i'm doing wrong?
Solved! Go to Solution.
Hi @JakobDahl,
Because when delete file will send an HTTP request to SharePoint, so the Identifier of the file should encode to URL formate, so you should replace these "/" to "%2F". So you could use the replace() function to process the file path, for example:
Best Regards,
Community Support Team _ Lin Tu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @JakobDahl,
Could you please share the screenshot of Flow configuration?
What's the action you are using?
This field should be an identifier of the file? sorry for the reason of language, I am not sure, maybe it should be the ID of file.
Best Regards,
Community Support Team _ Lin Tu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
This is the flow configuration,
I'm getting a value from PowerApps which corresponds to a filename in my document library in sharepoint, and then i proceed to delete the file (Slet fil) from the document librarry
Hi @JakobDahl,
Because when delete file will send an HTTP request to SharePoint, so the Identifier of the file should encode to URL formate, so you should replace these "/" to "%2F". So you could use the replace() function to process the file path, for example:
Best Regards,
Community Support Team _ Lin Tu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
You solved an issue which I am struggling for 20hrs now.
Thank you! Solved my issue as well.
Can't see how to upload any pics to this forum but I am sharing with you my solution, in case anyone else gets the same issue:
Regards,
Jose Angel Rivera
Thank you for this information, I am sure it is going to help, but how do covert it when the file name is dynamic?
Where would you put the command to to replace?
Hello, thank you for posting, this is very helpful. I am still having a problem with getting this JSON error. My question is the "compose_2" the actual file name? I don't have a compose, but I have a Create File that I am using. The file name is using dynamic information from a Form submitted.
Thank you for identifying the issue which is clearly a bug in the implementation of this action as no others require the path to be URL encoded.
Your solution however is incomplete, as it does not provide full encoding of all required characters.
Instead you should use encodeUriComponent() which has full URL encode logic thus:
Hello,
I know it's late answer but maybe it will help you anyway.
I think you can put your dynamic path into compose and that compose output put in replace function. Otherwise you can manually replace in action field: '%252f' instead of '/' and '%2b' instead of space ' '.
That's the usual awesomeness of Microsoft!
The documentation just says "File Identifier" and "Select a file", no further explanations, the error log was not meaningful, everyone was confused, ends up spending hours just for this.
Thanks, but it'd be great if this is updated in the documentation.
Good luck with that! 🙂
This is...the path I ended up taking to work around this delete/update sharepoint file issue. 😁
After I resolved the JSON error, I started getting a file is locked error (one step forward, one step back). There are a number of posts out there about setting up a DoUntil loop to check the lock status of the file, which seemed overkill to me if you know generally how long the lock is going to last (consensus seems to be ~7 minutes). So I just inserted a Delay action for 7 minutes, and it's worked during testing.
FWIW, the expression in my Compose 2 action is as follows, which references the earlier step where I create my Sharepoint file:
encodeUriComponent(outputs('Create_file')?['body/Path'])
Learn to digitize and optimize business processes and connect all your applications to share data in real time.
Come together to explore latest innovations in code and application development—and gain insights from experts from around the world.
At the monthly call, connect with other leaders and find out how community makes your experience even better.
User | Count |
---|---|
21 | |
21 | |
9 | |
7 | |
7 |
User | Count |
---|---|
32 | |
31 | |
24 | |
22 | |
11 |