How to interpolate data in a table

Hi,

I have a json array returned from a REST API:

[[{"Permission":"can_access","Description":"Can access this"}, { .. many more like this.. }]]

In the table, I get one row and many columns. It's not readable.

How do I transform this into two columns (Permission, Description) and many rows?

Hi @Francis,

You can look into the left panel of this app and check the properties of this query. I'd like you to look at query1.data property, assuming query1 is your REST API query. It seems like it is encapsulated in another array so you will need to find the name of that property.

I would assume since this is a REST API query, it would be {{query1.data.data}} is what you'd like to put in your table's data property.

Let me know if you still have issues and add some screenshots in your current setup.

I tried 2 ways. Neither works. This is the full object:

{
  "Results": [
    {
      "RoleName": "Admin",
      "Description": "internal",
      "Permissions": [
        {
          "Permission": "can_access_this",
          "Description": "blabla"
        },
        {
          "Permission": "can_access_that",
          "Description": "Blabla2"
        }]
        }
    ]
}
  1. {{ GetRolePermissions.data.Results.Permissions }} displays nothing in the table grid.

  2. {{ GetRolePermissions.data.Results.map(i => i.Permissions) }} displays it in columns. I need it to display the data in rows.

Hey Francis, for the data you shared, {GetRolePermissions.data.Results[0]Permissions}} works on my end!

Does that work for you?

Yes--I was missing the index Results[0]. Thanks!