Hi,
I am receiving a JSON object from an API call and have trouble saving it in Bubble.
The initialization works, I am shown the expected JSON response (array containing 3 JSON objects with message, status, name keys).
The idea is to poll every few seconds for the JSON array and update a corresponding data type which is then used to show the 3 JSON objects inside the array via a repeating group.
I have trouble finding out what’s wrong with my setup, any help would me much appreciated.
The API call also fails in the Preview when using this workflow:
In your API connector, you didn’t bset any double quotes around string value. So I guess you did it when you initialized it directly in value field. But in your action, you didn’t use :encoded as json-safe (this will encode the string and add double quotes around it). So you shoud probably set this in your action. However, if you have integer or boolean, you shouldn’t use :encoded as json-safe on them. Finally, if there’s any chance that you have an empty field, you may need to use terniary operator and set null if empty.
right! missed the quotes. thanks
however, I cant find a matching type (JSON) for the array of json objects I receive. e.g. to display them in a repeating group
Actually, you have set your call as “action”. You need to set it as “Data” to use it in RG. In RG, you will be able to set the data source for this type and use Get Data from API To call your endpoint.
the api endpoint has to be polled every few seconds for status updates from which some have to be saved for later use/download. that’s why I need it to be an action. works fine now, I just manually assigned each entry in the json array its own data field.