Filter List of Things by a list of indexes

Hey,
in one of my backend workflows I have 2 lists:

  • a list of things X (e.g., Thing 1, Thing 2, Thing 3, Thing 4, Thing 5)
  • a list of numbers Y — selected indexes of X (e.g., 1, 3, 5).

How can I get a list X2 which will consist of Thing 1, Thing 3, Thing 5 without recursive workflow adding Things to the X2 one by one?

Natively, only “items from #”, and “items until #” are available which doesn’t help here.
I tried playing with Server Script but couldn’t get it to work.

Any ideas?

Hey Nigel, thanks for the reply :slight_smile:
My question might not have been entirely clear — the list Y stores indexes of Things in list X.

I want to retrieve from list X only the items indexes of which are stored in list Y.
list X = [Apple, Banana, Carrot, Pear]
list Y = [2,4]

The resulting list should be [Banana, Pear] → retrieved item#2 and item#4 from list X.

Interesting request here, it is like the reverse of 1T - Index Finder Plugin | Bubble but you want a list version… :thinking:

If you share your script, we can completely ignore it help get it to work.

2 Likes

Well, today I made it work :smiley:
It was as simple as that:

Screenshot 2023-10-14 at 16.42.23
Screenshot 2023-10-14 at 16.44.41

Yesterday I gave up too easily trying to figure out how to process Things in the script.

Anyway, thanks everybody! :slight_smile:

3 Likes

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