How to read a list of a fixed number of elements

Hello,

I have a list of a fixed number of text elements. Example : my_list = [A , B , C]

I want to read the elements of this list by this way :

my_list[0]

my_list[1]

my_list[2]

The number of elements is a constant number not variable.

How can I do that in Bubble please?

Thank you

Hi, is my_list a single text element or already a list?

if single text element, use operator splitBy (with “,” if you have ‘A, B, C’) so it’s turned into a list

if already a list, just use a repeating group (type text or number)

  • use my_list as data source (or my_list:splitBy cf. step 1)
    • each item converted to number (if RG type is number)
  • put a text element in your RG and use current cell’s text (current cell’s number)

Hope that helps

1 Like

@Sam75 Use a RG like @eliot1 said if you mean to display the list. If you want to read an item in the list its simply the expression: “my_list:item#X” where X is the number of the index in the list you want to read (in Bubble an array/list starts at 1 and no zero).

1 Like

Thank you guys for your help ! both of your replys are very useful !