recordUpdates sending string data type for edited values although float is set as column type

This is causing data type mismatch during REST API call as it expects float data - not a string. Any insight or WA would be highly appreciated.

Hi @arunava! Since recordUpdates converts anything that was updated into a string, you'll need to do something like map through your data to convert any unwanted strings back to their original data type. Happy to help you with the JS if this is something that could work for you!

Are you editing any other columns, or just material_unit_cost?

Hi @victoria,

Thanks for the suggestion. I did exactly that yesterday :slight_smile: through a transformer. I will keep using it then.
I am also editing many columns.

BTW right now I am stuck on another problem. Although recordUpdates shows an array of JSON objects (edited rows), when I am passing it to REST API, it gets an object which is not an array. Any idea how to deal with it?

Screen Shot 2021-09-08 at 1.57.09 PM
Screen Shot 2021-09-08 at 1.57.20 PM

What retool call the API w/ not array anymore and hence the error. If I pass the same body through Postman, everything work.

Just as a quick sanity check, if you copy this value and use it in the Retool query, does it run as expected?

What do you mean by running in retool query? Sorry, I am not clear.

If you meant by hardcoding this array directly into Retool, I tried the same and produces same result.

It sounds like this was resolved over chat by adding a Content-Type header to the query :blush: Thanks for reaching out @arunava

1 Like