TeamDesk Knowledge Base & Support

   Home      FAQ      Forum      Idea Exchange      Ask a Question      My Stuff      Help   
suggestions for moving records up and down in a ranking
I asked this to support already but maybe someone in the 'TeamDesk community' has some ideas about this in the meantime...

I have a table of records which I wish the user to be able to 'rank' within a specific category.

please see attached using fictive example. Suppose users are asking to rank their foods preference by Cuisine. The results are sorted by Cuisine then by Rank.

I would like the user to be able to select a 'Cuisine' as a parameter in a view and then re-order the 'foods' in a ranking with 'move up' and 'move down' buttons in the list. When they click 'move up', the selected item rank goes down by one (becomes higher in the list), the item above goes up by one (lower in the list i.e. they swap places) and the rest stay the same. Once the item gets to the top, the button has no effect (or could be hidden). The opposite would occur using 'move down'

is such functionality feasible within teamdesk (or some creative alternative) other than the user just manually editing the table records ? This could get very time consuming if there are a lot of foods within one Cuisine and the ranking is not at all according to the user's preference.

Nick ranking example.xlsx
User Experience

Nick Ashcroft
Date Created
9/20/2018 8:53:36 AM
Date Updated
5/11/2022 3:54:57 AM
Michael Till 9/20/2018 3:07:48 PM
I would like this as well. My technicians set customer equipment lineups from Left to Right. I have it set so the number 1 record is the far left and the last is the far right. Having them set numbers as a sorting order is not very ideal. This would be very helpful.
Philipp Matuschka (MMB) 9/21/2018 10:59:48 AM
I have something similar, but not quite the same. The main difference would be that it seems in your example each item must have a different rank where is in my method multiple items can have the same rank.

In fact what I have is projects with tasks and priorities. For each task their is a P+ and a P- button to move up or down it's priority.
Nick Ashcroft 9/24/2018 5:41:46 AM
I have already implemented something similar with up / down buttons but it is not ideal. Indeed, as you say, its OK if you dont mind records with duplicate ranks since pressing one of the buttons up or down will just remove or add 1 to the rank so making it the same as its 'neighbour'. What I want to do is swap the rank of the 'neighbour' with the selected item rather than make it the same.

Problem is that it is not possible using a 'record change trigger' to also update other records, which is what is needed to update the 'neighbour' as well as the record being moved.

Other option I thought is to rearrange the list using the buttons and then 'select all' using a multi-record button and add a 'reorder' button but Teamdesk has no idea of the order to apply !

It would be nice if there was a built-in function where you could identify the position of a record in a view and use this somehow in the button assignment with a multi-select update.

Alternatively, another kind of record trigger which updates all matching records in a table and not only the current record. I know there are time and periodic triggers but theses are no good in my use-case.

other creative suggestions welcome ;-)
Philipp Matuschka (MMB) 9/24/2018 10:18:24 AM

What you can also do (and I always have to get a third party to do this for me as it is beyond my skillset) is after changing the record you are on, make a call to some outside resource (in my case through my web site) passing it the table, record ID and the columns you want change. The website then does some "PHP magic" or similar and changes the other record to what you want.

You can usually establish the record ID of the "other record" by some kind of a recursive relationship on the table in question and then doing a selection with an appropriate filter and sorting order.

Hope that makes sense.
Jorge Solá 2/10/2022 6:24:49 PM
It's possible to set it up so that you only modify the record you want to move up or down the rank (that is, without swapping ranks with the record immediately above or below) if you use a decimal number for the ranking.

I don't use duplicate rankings.

I set up a rank number with 5 decimals.

Then I set up a relation of the table with itself so that each record is linked to the ones above it in the ranking, through a match condition that says: [Rank] < [Rank], Then use the Index function to read the rank of the record immediately above (#1 when sorted by rank in descending order) & 2 records above.

When you click on the "Move Up" button by a record, it simply writes a new value as its rank. This new value is the decimal average rank of the 2 records above.

Record A: Rank 3
Record B: Rank 4
Record C: Rank 5.
Record D: Rank 6.

(Initial rank can be the record Id.)

When you "Move Up" record D, it writes 4.5 as its new rank, so it puts it between B & C. If you then "Move Up" record C, it writes 4.25 as its new rank.

If the record is already at the top of the rank, you can set it up so that the button doesn't show.

If the record is in second position, you can write as its new rank a value equal to half the rank of the preceding record.

You can similarly set up the "Move Down" button, or add a "Move to the Top" or "Move to the Bottom" button.

In a case like the one in the Excel sample provided, you can add a [Cuisine] = [Cuisine] matching condition to the relation of the table to itself, so that the rankings for each type of Cuisine are independent.

Then, if you want to display a nice integer ranking for the user (instead of the decimal real ranking), you can set up, in the above relation, a "# of records" function, read how many records have a lower ranking, & set up a Formula - Number column that adds 1 to that figure. That would be the integer ranking of the record.
Rick Cogley 5/11/2022 3:54:57 AM
I wonder if the kanban view could not be used for this?
Back to Search Results