How do you get two indexes from index in list block?

How to get two indexes from index in list block
Suppose this is a lost 7555,5643,7555,5432
Here I have used 7555 two times I want to get indexes of both these two 7555.
Anyone please give me idea how can I do this

you can remove that old item so that the index in list catches the next number

1 Like

From this, we know that the list selects the first item among similar items.

So, you can use the following blocks.

1 Like
2 Likes

Thank you @gordonlu310 I will try it

1 Like

Updated blocks, please read again.

You need to use the for each number block to iterate over a list with duplicates. The for each item block will return the first instance of a duplicate.

3 Likes

This is a good place to use a value function:
indices.aia (2.1 KB)


INDICES_TEST

P.S. These blocks can be dragged directly into your Blocks Editor workspace.

See A way to group projects by theme - #10 by ABG
for a demo.

8 Likes

I think ABG's solution is the most efficient.

3 Likes

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