Have a requirement where in we are showing only few columns in table.. however when user downloads .. the downloaded file should contains all columns including hidden columns.. Also wanted to change the name of the dowloaded file.
1) I am using Retool's exportData utility, which is accessible in Retool by default
2) If you want to use any custom formatting from the table, such as column mappers or sorting, you'll need to use Javascript to manipulate the table data, rather than simply referencing tableName.data.
3) While you can't trigger this Javascript from the native download table data button, you can still call this query from the table UI by using a custom button. Here's some instructions
Thanks @Tess for quick response .. it helps to some extent.. but have bit different requirement.. as per your message .. we cannot achieve this with table Download button instead we need to have custom button.. fine but i wanted to show this custom button only when there is a data in table and the query which will fill the table has got only few columns .. so i basically need to get the data from another source based on the data available in table.. is it possible with this solution..
like this.
select * from maincollection.data where id in (select id from searchButtontrigger.data)
with in utils.exportData as shown below.
utils.exportData(select * from maincollection.data where id in (select id from searchButtontrigger.data),'FileName',csv)
Thanks @Tess for quick response.. it is kind of working now using transformer.. but not sure why alert is not working .. can u please check
if(SearchButtonTrigger.data.length > 0){
const now = new Date();
const month = (now.getMonth() + 1).toString().padStart(2, '0'); // add 1 to get 1-based month index, then pad with leading zero if necessary
const day = now.getDate().toString().padStart(2, '0');
const year = now.getFullYear().toString();
const hours = now.getHours().toString().padStart(2, '0');
const minutes = now.getMinutes().toString().padStart(2, '0');