Support for Array of Objects in Tables

Currently, Tables accept an object of arrays only, that maps to how a SQL database would return data. Our REST APIs use, as one would expect, arrays of objects however, and this means that I have to write fairly complex transformations for every API call that needs to be shown in a table.

It would save us hours, and let us use our REST APIs more than database accesses, if tables had support for this notation. I'll provide some simple examples below:

Objects of Arrays (what tables require today):

 {
   "Col1": [0,1],
   "Col2": ["foo","bar"]
 }

Arrays of Objects (what our REST APIs return):

[
   {
      "Col1": 0,
      "Col2": "foo"
   },
  {
      "Col1": 1,
      "Col2": "bar"
  }
]

Hey there @church!

Table components should actually accept an array of objects. Are you running into any errors when trying to use your REST API data?

2 Likes

Yes, when I tried yesterday, it wouldn’t add any columns to the table, and I couldn’t manually add any columns to the table until I changed the data source. After changing the data source, lots of custom columns would appear based on how many times I had previously pressed it. Let me try to replicate here later today, and I’ll share.

Strangely, I cannot replicate it today. Now it is working, last night I struggled with it for some time, but the same API calls that resulted in a broken table yesterday, now behave as expected.

2 Likes