How to sync two list (BubbleSort)

Hello everyone, I am trying to make a leaderboard and I have two list, List1- Names and list2- Points.

List1 Items(Names): John,Peter,Andy,Lana,Jack

List2 Items(Points): 100,400,20,70,300

As you can see that data are fetched in a random order but I want to set the list2 in descending order and the List1 should follow the same pattern.The points allotted to the name will be same.
For eg-
List1(Names): Peter,Jack,John,Lana,Andy

List2(Points):400,300,200,70,20

I want the list to be set as shown above.

I have tried with an extension ListAddOn and it works fine for the Points list but I want to follow the Names list also.

I’m out of idea please help.

Try something like this

3 Likes

Ouu that’s great ,thank you so much for this.Let me try it.

It’s working fine but when we add same score twice then it will show the 1 name twice instead of showing two different names.

1 Like

@Sereno_Tech look here

1 Like

Another way is using ListUtils extension from AppyBuilder. This works if scores have same number of digits so I use a procedure to add leading zeros

1 Like

Bubble sort is so easy to create by yourself. Just read wikipedia, create your own algorithm from base blocks like if condition and while loop. If you do it by yourself you can sort 2 lists at once as the algorithm iterate identicaly trough lists - swap points are the same.

You can also make use of a list in a list. So at every position in the first list you have a list with a name and points, but in that case any lazy bubble sort extension won’t work.

In my case, when two same value of score then name list show same name.
Please guide to me
Thanks

Please check it.




Problem with same name with same number

Maybe this might help

1 Like

Dora_paz we check that but not get any solution.
Please check with two list according to my block image

I forgot about my old posts and created new blocks for that…
Try this it’s working.

4 Likes

Thank you sumit for halp me

1 Like