What is the .dataArray property of a query for?

I noticed there is a property on a query called .dataArray. I can't find any docs on it.

It seems to be the same as .data except inside of a single element array. I am using SQL so maybe it has some other use for JSON results or something I do not see?

Hey Bradley!

Great question and happy to help here! I believe it was originally set up to be an array of objects when your data returns an object of arrays. It definitely does not seem to be very useful in its current form. I've written up a bug report and added you to it so we can keep you up to date as a fix is merged for this. In the meantime, Retool comes pre-packed with two useful methods that can be useful here. formatDataAsArray() and formatDataAsObject() which can be used to transform data back and forth between the two commonly used data structures.

Hope this helps, let me know if you have any questions! :)

2 Likes