So I am havnig some issues with setting the body of an API PATCH request to firebase realtimeDB. I am not using the in-built thunkable blocks as I am mainly using cloud firestore to store my data, except for this part which was easier with the realtimeDB. Here is what my json tree looks like:
What I would like to do is change the availableQTY, based on user input, and save a log in the same tree. The problem I am getting is that using the create object
block requires pre-set data for the object key, which would cause multiple alterations to only show the most recent one and not show all changes that were made.
Here is an example of what I would like the change to look like in the realtimeDB, as well as the successfull requets from postman:
-H "Content-Type: application/json"
So whenever a change is recorded, the object key is set to the day the change was made so that the next time another change is made, a new entry will be made and both will be recorded as different children of the usage-reports
object. Does anyone know how to make this work in thunkable X? Here is my attempt with results. The red text is set to only show when status != 200
:
Attempt 1 (Set body using text blocks)
API URL
API Body
API Response
It seems to me that the body is set as is on postman which was successful, yet fails in thunkable. I also tried a few combinations with generate JSON from Object
, and get object from JSON
, as well as removing the quotation marks before and after the app variable apiResponse - new-qty-input
block but the response has been the same each time.