ListPicker from List of lists

I have a list of list populated from a csv file (2 columns) with "list from csvtable", is it possible to populate a ListPicker with the first column without a For Each cycle ?

What is wrong with using a for each cycle ?
How else do you expect to extract the data from one of the columns (regardless of how you do it, you will have to iterate over the list in some way)

Nothing is wrong, I'm using a cycle, I'm trying to optimize my code, I don't know very well the lists

The use a for each loop to get your items (perhaps with list of pairs?)

Look in the dict builtin blocks for

  • a block that turns a table (list of lists) into a dict, and
  • a block that gives you the keys of a dict.

    Assign this into the List Picker Elements.

or use a clock

Thank you very much, it runs well, my blocks

You can optimize your blocks further by keeping the dictionary in a global variable,
and by doing your lookup directly from that dictionary by key = ListPicker1.Selection

Do you mean so ?

1 Like

Yes, that's cleaner.

Thank You very much for your help

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