Hello,
I am designing a website in which users have a score that can change through time.
I would like to display on the user’s profile page it’s rank, when sorted using this score.
Is it possible to retrieve the index of an item in a sorted list ?
For instance, if I sort the Users by score, can I get the index of the current user inside this sorted list ?
Thanks !
Edit: I am sorry, I just thought of a solution just after posting…
In my case, I only need to do a search for Users that have a higher score, and count the number of items in that list.
The rank of the user is this number + 1
3 Likes
ahhh genius, solved my problem. Thanks for sharing the solution!
Hi! Can you share specifically how you achieved this?
I have a list of things (hamburger recipes). Each thing has a name, and a score from 1 - 100. 100 is the highest ranking score and 1 is the lowest. Scores change over time.
When a user creates a new score for a thing, I want to update and save the rank number for each burger recipe in the database compared to all recipe’s scores.
Example:
Regular Burger | Score average: 90 | Rank: 1
Spicy Burger | Score average: 85 | Rank: 2
Veggie Burger | Score average: 80 | Rank: 3
When users submit a new score, how do I with a workflow update the rank value in the database?
Example:
User submits new score for Spicy Burger of 100. New Average Score = 92.5
Therefore Spicy Burger gets highest ranking:
Spicy Burger | Score average: 92.5 | Rank: 1
Regular Burger | Score average: 90 | Rank: 2
Veggie Burger | Score average: 80 | Rank: 3
How do I achieve this with a workflow?
In a repeting group create a input field with dynamic data.
Do a Seach for Hamburger recipess (add new constraint; Score average > current cell hamburger recipes’s Score average):count+1