Array To Inline

Hi,

Does anyone succeed to convert an array resulting from an API column to the inline list component?

Thanks

this?

Nope that doesn’t do it

Hola,

It’s more a trick than a procedure but worked for me.

Here you can see it A Google Sheet working as a REST API: good or bad idea? 💣

1 Like

I tried the method you did but it splits only the values but the inline list component can’t read it to show as a list

Hola de nuevo,

Some screenshots will help a little.

Do you have your JSON paylod (API answer) converted to array? Something like this:

Step 1

Step 2
image

Step 3

Bye

I successfully split the array and resulted to the last screenshot but the issue when I try to map it to an inline list its not working

2 Likes

Have you successfully mapped into an inline list ?

Have you successfully mapped into an inline list ?

Yes!

The next steps are:

Step 4
Put your new array in another table (where your Inline list will point out) using a Single Value column

Step 5

Create so many columns as parameters your API call has. In my case, I have 6 parameters. These columns must be Single Value type using your array column as main source (step 4) and its Row parameter must be pointing out some position (item) of your array.

If your JSON payload has the same schema/items always, that Row parameter can be a static number otherwise, you have to create some logic to retrieve the right array position and find the desired value (what I did).

I hope it helps you at least to know what to do.

Feliz noche!

4 Likes

As @gvalero pointed out, you can’t simply use an array resulting from a string in an inline list. You must have rows attached to each of them.

1 Like

So I will have it as a static row then map them via single column

Well it works this way but in this case we wouldn’t be able to create a dynamic row, am I getting it right?

As long as your API result is dynamic then it will be dynamic.

I don’t thing you got my concern

I have to manually create an empty rows with numbers in order to connect them via single value

The issue is in this case I won’t be able to expand them since there is no function in glide can do that

Say I got a row limit in an empty sheet to view the array in which has 100 row

What if my array got a 110 resulted data ?

You’re right that the rows count is not dynamic and you have to pre-create that, as much as you can.

As I have explained above, you’re trying to create rows out of a JSON payload. Glide needs to have rows attached to each item in the JSON to have a details view for each of them. You can’t just have rows from an array out of the blue.

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.