cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
JakobDahl
Helper I
Helper I

NotFound - The response is not in a JSON format.

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:

UHKOfo1

Flow ErrorFlow Error

 

Even though the file does exists in the document library.

 

7tIwMae

 

Can someone tell me what i'm doing wrong?

1 ACCEPTED SOLUTION

Accepted Solutions

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:

Annotation 2019-12-11 172200.png

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.

View solution in original post

13 REPLIES 13
v-litu-msft
Community Support
Community Support

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. 

Annotation 2019-12-11 110348.png

 

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

 

d20YIUy

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:

Annotation 2019-12-11 172200.png

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.

Perfect! That did the job.

 xSzptwR

Thank you alot @v-litu-msft 

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:

 

https://riveratec1-my.sharepoint.com/:i:/g/personal/jrivera_riveratec_com/EQvPBZDmAmdMnPSfiuuptM8BSD...

 

Regards,

 

Jose Angel Rivera

ocmcadams
Regular Visitor

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?

 

ocmcadams_0-1600215385158.png

 

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:

encodeUriComponent(outputs('Document')?['body/{FullPath}'])
 

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 ' '.

radityoardi
Frequent Visitor

That's the usual awesomeness of Microsoft!

radityoardi_0-1626255413439.png

radityoardi_1-1626255475815.png

 

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'])

 

delete_sharepoint_file.png 

Helpful resources

Announcements
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.

Microsoft Build 768x460.png

Microsoft Build is May 24-26. Have you registered yet?

Come together to explore latest innovations in code and application development—and gain insights from experts from around the world.

May UG Leader Call Carousel 768x460.png

What difference can a User Group make for you?

At the monthly call, connect with other leaders and find out how community makes your experience even better.

PA Survey Carousel Image.png

We want to hear from you!

If you are a small business ISV/Reseller, share your thoughts with our research team.

Users online (2,972)