Manual sorting

Is there a way to implement manual sorting for lists? For example, I am creating an app for my band with the list of songs we play. Each song is a card with a name, chords, tempo, etc. I would like to sort cards by drag-and-drop to have the songs in the order we play them.

Drag and drop for reordering lists is not possible.

But I think you could get close to this with clever use of the Increment action…

  • create a numeric column, and use this to sort your song list (probably highest to lowest)
  • use an increment action to add 1 to that column each time you tap on song in the list

The effect of that should be that tapping any song should move it up the list

Thank you, @Darren_Murphy, that’s a way to go! Yet tapping on the card should open the details screen (lyrics, comments etc.), so I will have to think of something else to tap. There’s no “long tap” in Glide, right?

1 Like

No long tap, no.
If you still need to view details, then another option could be to add two floating buttons to the details screen - one to increment, and the other to decrement. This would be a little more cumbersome, but should still work.

1 Like

@yann just for a bit of fun, I made a quick mockup to see how this could work.

Look for the “Playlist” tab.
The app is copyable.

3 Likes

Got it, thank you! The problem with incremental sort is that you don’t really know, how many time you should tap to have the item in the position you want it to be - because you don’t know the ratings of other items. So your first suggestion (to make the card action “increment”) is better because you can immediately see the result.

I ended up with two screens: one for setting up the setlist (check & sort), the other - to display the result. So the card action is “increment” on the first screen and “details” on the second.

1 Like

Yeah, that also occurred to me.
You could probably add something to the details view that indicates the current position of the song in the list, and get that to update dynamically as you tap the buttons. But maybe that’s more work than it’s worth…

Hi Darren!
Thank you for the mockup, I’ve think the same direction with a Flow Button by increment\decrement a Sorting field.
This works great for a few Songs, but seems it would be not so easy for tens or hundred of Photos… Seems for the last case we have to assign some Value (Order #?) to the Sorting Field when we add a new Item?

Hi!
This topic appeared just on time because I could use you expert help on this as well.
I have a relation list that I Join as templated column to turn to a HTML table.

I sort the list using the sort number but the HTML table isn’t effected because
the sort of the join list from the relation only knows to go by sheet order.
Is there any way I can Sort it within the table by a numeric column?
any HTML trick for it?

Maybe this?

2 Likes

YES!!
Thank you again and again and again :star_struck:

1 Like

I’m happy it’s finally useful for someone other than me :slightly_smiling_face:

Actually, @Lin_Altshuler I just noticed that post links to a Replit repository. I moved all of my code columns to GitHub some time ago, so I’m no longer maintaining the replit repo. Here is the link to the GitHub repo if you need it:

https://mcdarren.github.io/glide-jl-sort-by-keys/

4 Likes

Just want to say thanks again for that thread. It helps me a lot with creating charts in Quickchart or YC columns :wink:

2 Likes