Create a sequential counter/score for RG cells

I have a Repeating group which is populated by making selections from another Repeating Group.
The RG of selected things can then be put into the order of the user’s choosing through a drag-drop re-order function, which having followed various tutorials, and playing with available templates works beautifully. (Thank you @romanmg, @NigelG and @fayewatson among others- you are all amazing and explain things very clearly!)

Each item selected by a user ends up with an “Order number” which gets progressively larger the further down the list you go.

What I eventually want to do is to assign a score for each cell, eg:
-the first placed selection receives 25 points
-the second receives 18 points
-the third 15 points etc
These scores will eventually be aggregated across different User’s selections to find an overall order; a winner, a second place etc.

My starting point has been to try to create a sequential “counter” for each of the RG cells, which would then get saved to the database>
1st place would be 1
2nd place would be 2 etc.
I have tried to save each cell’s index number to the database in order to do this, but I have not yet found a way which works.

Once I have the sequential number assigned I would like to update another field with the corresponding score for this user’s selection (25 for 1, 18 for 2 etc).

I love Bubble, and I’m not prepared to give up easily, I simply have never been a programmer, and so am probably approaching this all wrong. Any pointers would be very much appreciated!

1 Like