I have an editable table and want to save the changes to the backend of my application. To do so, I use three elements:
The table's changesetArray
An OpenAPI resource (with a POST endpoint that takes an array of changes as a request body)
A transformer that maps the rows from the changeset to the format the API call needs.
The problem?
When I hardcode the transformer's value in the request body, it works. When I use the transformer's value as a variable in the request body, it fails with this error message:
As you can see here, I'm passing an array, and it works. And it's literally the same output that the transformer produces.
As an extra hint, I took a look at the network tab on my browser, and copied the body of the requests (hardcoded and variable reference) and I see that it's different:
Yes, this must be frustrating if your transformer produces the same exact result as the hardcoded data. Can you try it with a regular javascript query instead of a transformer?
Also, would you mind exporting your json to me so I can take a look at your data? Please also provide the api resource. Thanks!
I just want to share that I notice the same problem too on my local retool.
while troubleshooting I can confirm from my logs that when this problem occurs it is not hitting my API at all.
I suspect it is not treating {{ as a reference to a variable and just tries to parse it like it is the raw input thus complaining about the unexpected { at 1 . so retool just stops and not make the request
I'm still trying to figure out why, but currently clueless.