Forum Academy Marketplace Showcase Pricing Features

[Solved] Repeating Group Sorting function with Up/Down arrows?

I have a list of things displaying in a repeating group. I would like to create Up and Down arrows in order to allow the user to order/sort the results in the repeating group.

Concept: User adds Quiz questions to a repeating group. User would like to sort the Quiz questions visually one-by-one using an Up arrow to move the item up the list (or decrease it’s index value), or click a Down arrow to move the item down in the list (or increase it’s index value).

What is the best strategy to set something like this up?

Thanks in advance!

2 Likes

I solved this on my own… here’s what I did, I got a hint from another post, but I did it slightly more simply by adding and subtracting current and previous element Sort ID fields:

Create a Workflow on the Up Arrow (When you click the UP Arrow)
Follow the Workflow I did below:
For Make changes to element step 1:

For Make changes to element step 2:

Now just do the reverse for a Down Arrow element:
For step 1:

For step 2:

Additional Notes:
I created a new column in my table for the Sort Number. When ever a new question is added to the list, I have that Sort Number created based on the last list item Sort Number + 1. This ensures that whenever a new question is created in the list, it automatically assigns it a sort number. See below:

To finish up, I also added some conditions for the Up/Down arrows, to hide the Up Arrow when the item was at the top of the list, or hide the Down Arrow when the item was at the bottom of the list.

and

Have fun.

4 Likes

Hi, I did what u wrote, but Items is not moving

If i see App Datas - Up/Down buttons changes Sort ID’s but on Preview my Items is not moving…

UPD: Forgot about Sorting is Descending order in Repeating Group, but if you Up/Down buttons many times it goes like +1 or -1. For example i have 3 elements. Sort IDs = 1, 2, 3 . But if i click UP many times it goes like 6,2,3

Great!

I followed your instructions here and it worked perfectly!

Thank you very much!

Oldie 2016 a really nice goodie 6 years later . Thank you @shadowmaxss !! This worked perfectly for me, too.