Dropdown connected with custom state - need help

I created a dropdown where I display a list of surveys that the client can attach to a project.

Inside the focus group, I have a repeating group with the surveys. When a survey is clicked, it is added to a custom state (list).

Next to each survey, I want to display the number (position) that the survey has in the custom state. I also want the numbers to update automatically, for example when the client deselects a previously added survay.

How can I do this?

I believe you would reference the index of the item in the list to get the # of that item in the list