[BUG] - trailing WS in column name

Hi - I'm using the Dropzone tool to upload a CSV.

That CSV has 5 columns, and I want to display them in a table. However, when I do this, I get this error:

CleanShot 2023-07-22 at 11.51.05@2x

CleanShot 2023-07-22 at 11.51.19@2x

This is weird, because ad_unit_id IS in my data, and Retool knows to look for it there - the column is fine, it's just an array of strings, so what's going wrong?

Well, eventually I realised that, in the CSV I uploaded, the column name ad_unit_id has a trailing white space - you can see that here, with the space between id and the colon:

CleanShot 2023-07-22 at 11.52.19@2x

I think what's going on here is something like:

  • in uploaded CSVs, column titles are left as-is, including trailing WS
  • but in the names of a table, Retool runs a trimws() or equivalent function, so that the column names are always set to remove WS.
  • so when the table goes to look for the column "ad_unit_id", it finds only "ad_unit_id ", and hence throws an error.

This seems bad :smiley:

Hey @Henry14 thanks for surfacing this! I'm able to reproduce that the File Dropzone component does preserve whitespace in the column headers when uploading a .csv with column names that have trailing spaces, and can see how that's problematic when trying to access those columns downstream within the app. I've filed a bug issue for this internally for our eng team and will keep this thread updated with any updates!

1 Like