Forum Academy Marketplace Showcase Pricing Features

Last/First element of GET API array

I’m retrieving data from an external GET API. One of the fields is an array: [1,2,3,4,5]

How do I display the 5th element of the array? ‘First/Last of …’ is not visible

Make sure the data type is a list, if it is a list then you should be able to put “item #” if you made the API in app connector then this should be an easy fix by modifying the call types to make it a list rather then text.

@codurly where to find the list type in the API connector GET call?

If for some reason you can’t get the API connector to recognise it as a list, you can set it as type “text”, then use the :extract with regex to split the string into a list of strings, and get at each value that way.

the point is, when I set it as a texts Bubble doesn’t recognize the fields as a number anymore so I can’t round the numbers to 0 decimals. In the case described I added unique random numbers behind each decimal because of this issue: Only unique elements in API array :pensive:

Yes, the messy workaround for converting text to number is to use an input element on the page to convert it… which is no good for server actions.

Ideally Emmanuel will fix the API connector following your bug report : )

This topic was automatically closed after 70 days. New replies are no longer allowed.