Is there a way to get the index of a specific item in a list?
So internally a list is like
[1]=red
[2]=blue
[3]=green
If I already have the item number (like 2) I can use it to return “blue” with :item #
But what how do I find the item number in the first place?
Specifically, I’ve got a repeating group that of course has a list of data. I’d like to number each cell of the repeating group according to its position. So that the first cell has a (1) in it and the second cell has a (2) in it and the third cell has a (3) in it and so on. It seems like I should be able to just grab the index of the current cell, but I don’t see an expression to get that information.
Huh, neat! I never noticed that before. Maybe because that option doesn’t appear for any element that’s in a group in the cell. I only see it for elements that aren’t grouped.
You can see that this text, which is inside of group Action_Header, only has access to its parent group’s action, not to the cell it’s in.
However, this random text element I added as a test does have access to the cell’s index as long as it’s not grouped
My guess is that the current naming convention would make it a bit confusing in nested cases (e.g. which of the two “Current cell’s index” refers to current, as opposed to parent, cell.
Seems like the current expressions should be able to handle that now. Something like “the current cell’s current cell’s current cell” makes just as much sense as the expressions I’m already building.
Hi, I have exactly the same question, but I am not using a repeating group.
I am using a list in an external API, and I want to find the # Index of a specific element in this list (let’s say “Blue” in the example above).
I am not storing this list into a database, just using it as a data API list.