Why does my use of setValue seem to coerce strings to numbers?

I am using setValue to create an array of POJOs in order to populate a table. (The setValue invocation itself is triggered by a user selection of a row of another table.) It seems that setValue is coercing each value to a number (or 0 if that is not possible). How do I prevent this behavior?
On a note which is perhaps related, all of the data that I'm feeding to Retool are strings, but it seems to coerce many of those strings to other data types, such as numbers and "tags" (whatever those are). How do I prevent THAT behavior?

NVM in re my first question, because I now see that it was the second table that was coercing the strings into numbers, not the setValue invocation itself. That said, it's still not clear to me as to why Retool is trying to coerce my strings into other data types, without any direction from me.

1 Like

You can always set the type by doing either {{Number(variable)}} or {{variable.toString()}} if it's going the opposite way, but I'm glad to hear you got your problem resolved.

1 Like

what were your table column data types? String?

Most of the columns ingested by the table were javascript strings, but - I now see - some sort of Retool voodoo assigns Retool-specific data types ("Tag", etc) to these columns at the moment of ingestion. I also now know how manually to reassign the types of those columns back to strings. Accordingly, I'm now in much better shape than I was a couple of days ago. Thanks!

2 Likes