How to get the index of keep items

List of numbers:

  • 0
  • 0
  • 5
  • 0
  • 6

I am using this keep items block in [Image 1] which is giving me the answer that I want perfectly fine.. However, I would like to get the index of the result of the keep items block. I've tried doing [Image 2] but it's giving me index of 0 instead of 3 like in [Image 3].. Could anyone suggest me ways to do it? Thanks!
image [Image 1]
image[Image 2]
image [Image 3]

[scratchblocks]
index of (item (item) of (keep items (<[ ] > [0]> @addInput::grey ring) from (ipitemCount):: list)) in (ipitemCount)::reporter list
[/scratchblocks]

What if I would like to retrieve data from another table with these indexes.. I've tried this


but its giving index of 0, if i remove the item like shown in the image below... then it would work but only for the first one as its written there (item 1 of...).. how can I get all of the data based on all of the index.. in this case index 3 and 5 so I want to retrieve the data of index 3 and 5 from another list
image

Oh ya... I was just testing by using script variables so ignore the name of the variables

So something like this?
or

If I'm understanding correctly, you want something like this?

Yet another way to deal with indices, one that works in many other situations as well, is to put them in the data structure at the beginning of the computation:

Then you can do the filtering you want, remembering that the value you're interested is ITEM 2 OF each row of the table:

And finally you can pull out the indices: