When uploading files, specifically when using Interface upload button (retool api), my csv can have indefinite amount of columns meaning it can have 1 or 10 columns, so my app need to be able to read it. I know in retool you need to build table and your csv needs to be inline with the table format, but in this case it should be dependant on csv format?
Hello @feruz111!
The table component is dynamic, so that when it takes in source data, under the hood it will parse out how many columns it needs to display and will adjust accordingly.
It looks like you are trying to pass data into your table from fileButton1 component, I tried to reproduce this and it seems that the csv data is base64 encoded and stored at fileButton1 .value[0].base64Data
and there was not any data inside of fileButton1.parsedValue
If the data from your CSV is in the same location, I would recommend using a JS Query/transformer to un-encode this value and pass the output of that into the component.
The other option would be to use a Query to upload the data to your DB then to fetch it to the table. But I am guessing you are looking to have the table preview the csv file data before it is uploaded, would that be correct?
The only issue would be if you have a situation where you want to try to combine multiple different table schemas from a database onto the same table component.
Such as if you upload a CSV with 5 columns, display this in a table, then try to add in a table from another CSV stored into your database with 10 columns.