How to get multiple index from a list

Hi all,
I have a list which has many items and many of them are repeating. I wanted to get the index of all the items that match with “batch1” but when i use the index in list block i get the index of only one item so how can i sort of this problem?

By using for each number loop.

how can i do it… can you show me blocks?

First try from yourself.

2 Likes

yeah definitely I’m asking how do i do it; what do i put in for each number block

See here:
https://docs.kodular.io/blocks/control/#forrange

I think you are not understanding what im asking… I know what is the use of for each number block but what do i set in ‘to’ of the for each number block like how many times should it repeat?

As large as your list is.

1 Like

So how will it get all the indexes whichever item contains “batch1”?

Use if condition.

Summary:
Just what @vknow360 said,

The left one returns a list of all index, the right one returns a text with all index

Whatever list is your list

If it worked then mark @vknow360 as the solution

2 Likes

I want a procedure to run when all the items containing batch1 gets added to the second list so how can i program that when all items containing batch1 has been added to the second list?

What do you mean?
Just do that:

Or if you want to check if all items containing batch1 has been added to the second list,

1 Like

I’m getting error when I do the first one you told to do

Your list is empty. You should understand error messages.

This error isn’t related to this topic. In my solution, I don’t have any math operation. So this is on you.

1 Like

Please mark @vknow360 as the solution.

1 Like

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