Update record not working error

Hi do you know why the update record gives me this error?
Do you find any mistakes in the relative path
All the other apis work perfectly

Has anyone made it work?

From what i found out the update record for firebase function doesnt work in appgyver editor (because from what i understand appgyver uses put method and firebase needs patch method) (as for now)
So the only way is by using HTTP request.
This way i made it work.

@Dimos_Vamvourellis, @Nick_Arts, @stayfoolish, @JOHN_WORSHAM

from other AppGyver forum questions it seems you know how to update a single field in the firestore database through the HTTP request and the PATCH method. I really need your help!

The URL is set to: https://firestore.googleapis.com/v1/projects/YOURPROJECTID/databases/(default)/documents/YOUCOLLECTIONID/YOUDOCUMENTID with YOURDOCUMENTID is the id for that specific user.

If a button is tapped, the calories should update to 600.

I am pretty sure, the request body is wrong, but I just don’t know how to it should look like when you say “in the right schema” - I am a complete beginner …

i think your problem is either your request url or the request body (the request body seems more like it)
for the url i suggest you make it a formula and in the format of the following image. (I dont know if you have already)
As for the request body you can get the format by creating a REST API direct integration resource for your collection and by making a test request, you can copy the request body format.

1 Like

Your URL is right as for the request body it should be {“fields”: {“calories”: {“integerValue”:600}}}. Also, check the permissions in rules tab in your Firestore database.

1 Like

Thank you very much for this quick response.
By copying the request body from the test, I was able to get it to work.

1 Like

Nice! When developing using HTTP Request, take a look at postman. It’s a good way to test http requests before implementing it.

1 Like