Autogenerate columns to table via code

  • Goal: I have a file upload button that will accept a variety of CSV files (different columns and formats). I want to show the data in a table component immediately after upload but I can't figure out how to regenerate the column headers in the table component.

So far I have been able to get a query to list the column headers from the new file automatically, but I can't get that to translate to the table.

I know this is probably very basic but any help you can provide would be appreciated.

Hello @Ian_Stribling and welcome back!

I think the you should be able to use the dynamic column settings within the table component to generate these columns from the parsed File Upload data. In this example I used a JS Query to return the parsed information and tested with files containing different headers:

No change to the table settings, but new column headers from a different CSV:

2 Likes

Thank you! I didn't see the dynamic column settings check box. Really really helpful!

2 Likes