I am reading GMAIL contacts into a variable and then displaying them in a table. The table should automatically generate the columns from the DATA in the variable. It works for all columns except the ADDRESSES column. I suspect the TABLE component is not reading the first key in the list?
Refreshing the table does not work. I can display the data from the variable in the JSON editor component and it shows the ADDRESSES data ok.
Hi @jebit,
Have you tried clicking on the "+" button and see if you can manually select addresses as a source for a custom column?
Yes - done all that. You can add extra column but the source dropdown does not contain the addresses source.
Strange... this is a long shot, but could it be the addresses it not present in all arrays? I can see the keys are not equal for each one.
Correct - not all contacts have all columns, but all possible columns should be available in the table. I don't know what the table component uses to regenerate the columns but it can't be based on just the first record in the data as that only has 8 keys.
Hey @jebit,
Just linking this similar issue and the solution from another user, hoping it can help you.
Hmm I haven't been able to reproduce this yet with dummy data
These steps might help us track down the issue:
Does addresses show up in a brand new table component?
Does addresses show up if you enable dynamic column settings on the table with label {{item}}
, like this:
If you're still not seeing the column, would you be open to sending me a DM with a more detailed example of the data structure?
Addresses don't show in new table. Creating a new table with dynamic columns makes no difference.
However - I can create a new table that uses the selected row as the data source and that does show addresses, so the data is in there somewhere!
I was hoping to change the data source in the main table to just a single row that contained all the fields but that just gives me an error that the value is empty although the error then shows the data.
Interesting For the second screenshot, I think if you wrap {{v_googleData.value\[1]}}
in square brackets [ ]
it should show up
I think I cracked it. The addresses column only shows up if at least 1 of the first 10 records contains address data. As soon as I remove the data from those rows, the addresses column gives an error and vanishes when I refresh the columns.
Yep! I'm seeing the same issue Thanks for narrowing it down!
I will flag this to our team. In the meantime, I'd recommend adding some JS to map over each record and make sure the key exists for each row (even if null/"")
I discussed this with our engineering team internally, and it sounds like this issue is actually by design to help with performance. To save time, we look at a random sample of rows, rather than all of them.
The also suggested transforming the data to always include the column (even if empty) into each entry before passing it to the table.
I really appreciate you flagging this behavior to the community! We updated our table documentation to explain this behavior
Thanks Tess. If only everything could be solved by adjusting the documentation!
I'll start learning the ajv library to fix the data. Cheers!