My requirement is
- I have an data from API that i need to store in table and display this is done
- Now i need to convert/ pass some columns data from table to CSV how to do in retool
My requirement is
Hey @naveen!
You can try using the "Export data" event handler for this along with the _.pick
function, together that might look like:
If you're looking to do it in a script there are a couple of utilities you can also try, The first is utils.downloadFile
, how to download CSVs with that is outlined in our docs here. You can also use utils.exportData
which will automatically download your data as a CSV:
utils.exportData(_.pick(formatDataAsObject(table1.data), ["columns", "you", "want", "selected"]))
Note: If your data is already formatted as an object of arrays you can go ahead and drop formatDataAsObject
from both examples