Saving RG's "current cell index" to database (automatically)

I have a RG set to list items numerically by price from lowest to highest on page load. Their position on this list (their rank) when sorted this way is very important. I would like to store the “current cell’s index value” (their numerical rank on this list) in the database when the RG is first loaded. That way, when the items are sorted in other ways, such as alphabetically, the previous rank value can still be observed.

The only way I have found to save the current cell’s index value to the database is to create a button within the row and then assign it to “change a thing”. However I need this to be automatic for each cell, with no buttons.

Alternatively, if there is a way to continuously calculate and update a stored “rank value” by analyzing a sorted database each time a new entry is submitted, that would probably be a better approach.

I hope I’m making sense here! Any help at all is so very greatly appreciated. Thank you in advance.

You can calculate rank by summing up the records that are above this in the list (so where amount < this amount + 1)

When you add you can then recalculate the entire list.


Thank you for this