Favourites Changing when rows reordered

Hello,

This is probably not a bug, but I wasn’t sure where else to post it.

I have hit an issue with the favourites functionality where the Is_Favorited? flag changes when the data in the underlying sheet is reordered. After much trial and error, I managed to come up with a simple test case that reliably replicates the problem.

Glide App Link: https://sincere-hand-8796.glideapp.io/
Google Sheet: https://docs.google.com/spreadsheets/d/1Hr7MZpswA-aJBbT370syzkbR9O1Ot2Yv7MSe8SPr71o/edit#gid=0

The Google Sheet contains just a single column of names.
I have added a RowID column, as is recommended.

Steps to replicate the problem:

  1. Select any name in the list (eg. Dustin Johnson), and add as a favourite. Checking the data shows it correctly tagged as Is_Favorited?.

  2. In the Google Sheet, select all the data in both columns (Name & Row ID), and reverse the order (ie. Sort Z-A by Name). Dustin Johnson is now row 14, but his Row ID has not changed.

  3. However, Dustin Johnson is no longer tagged as a favourite. Instead, Mackenzie Hughes is the favourite - the Is_Favorited? tag has remained with Row 7.

The weird thing is that if I “Unfavourite” Mackenzie Hughes, then the Is Favourite flag immediately returns to Dustin Johnson.

Any assistance on how this behaviour can be explained/resolved would be very much appreciated.

(I did have a bunch of screenshots to go with this, but there seems to be a restriction on new users including screenshots, so I couldn’t add them)

thanks,
Darren

Hi Darren, what is your favorite component pointing at. I think a favorite action is pointing to a column, is it your row iD?

Hi Thinh,

Thanks for the quick response. Yes, as I’m using RowID, the Favorites component is pointing at that (and there is no option to change that - as expected).

Favorites are being applied correctly, it’s just that when the rows in the underlying sheet are reordered that things get messed up.

Darren

Is there any particular reason you are sorting in the sheet? The Row ID should be preventing this issue, but sorting can be done in the Glide builder.

Sounds similar to this thread, but if you watch the RowIDs, do they ever revert to their original value after you sort in the sheet? For example, they will move when you sort, but jump back a couple of seconds later? It could be a weird sync issue with a large amount of data moving around.

1 Like

Hi Jeff,

Nope. When I do the sort, the Row ID’s also get sorted and they don’t change.

My actual application is a Golf Sweepstakes leaderboard. It’s also published from within GSheets - you can see what it looks like here. It’s updated frequently (every 5 minutes), and after every update the leaderboards are reordered.

The workaround I have in mind is to leave the original worksheet intact, and create a second one to drive the Glide app, where the rows get updated but never sorted. But that’s a bit clunky…

thanks,
Darren

Not sure why you would have issues with favorites then when using rowid as the key value. If you don’t use RowID, then you have the option to set the key. But in either case it shouldn’t matter.
image

In general, I try to avoid sorting the data. I would probably use the second sheet option. You should be able to fill it pretty easily using a Query formula with an Order By.

This is a bug in the frontend. If you reload the app the favorites will be back where they belong. We’ll fix this bug.

3 Likes