# Favourites Changing when rows reordered

**URL:** https://community.glideapps.com/t/favourites-changing-when-rows-reordered/14573
**Category:** Report a Bug
**Created:** [August 24, 2020, 3:02pm UTC](https://community.glideapps.com/t/favourites-changing-when-rows-reordered/14573 "2020-08-24T15:02:18Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![Darren\_Murphy](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/darren_murphy/32/47326_2.png) [@Darren\_Murphy](https://community.glideapps.com/u/Darren_Murphy)
#### Post date: [August 24, 2020, 3:02pm UTC](https://community.glideapps.com/t/favourites-changing-when-rows-reordered/14573/1 "2020-08-24T15:02:18Z")

</div>

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/](https://sincere-hand-8796.glideapp.io/)  
Google Sheet: [https://docs.google.com/spreadsheets/d/1Hr7MZpswA-aJBbT370syzkbR9O1Ot2Yv7MSe8SPr71o/edit#gid=0](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

---

<div class="post-metadata">

### Author: ![ThinhDinh](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/thinhdinh/32/49_2.png) [@ThinhDinh](https://community.glideapps.com/u/ThinhDinh)
#### Post date: [August 24, 2020, 3:06pm UTC](https://community.glideapps.com/t/favourites-changing-when-rows-reordered/14573/2 "2020-08-24T15:06:22Z")

</div>

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

---

<div class="post-metadata">

### Author: ![Darren\_Murphy](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/darren_murphy/32/47326_2.png) [@Darren\_Murphy](https://community.glideapps.com/u/Darren_Murphy)
#### Post date: [August 24, 2020, 3:12pm UTC](https://community.glideapps.com/t/favourites-changing-when-rows-reordered/14573/3 "2020-08-24T15:12:43Z")

</div>

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

---

<div class="post-metadata">

### Author: ![Jeff\_Hager](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/jeff_hager/32/43_2.png) [@Jeff\_Hager](https://community.glideapps.com/u/Jeff_Hager)
#### Post date: [August 24, 2020, 3:27pm UTC](https://community.glideapps.com/t/favourites-changing-when-rows-reordered/14573/4 "2020-08-24T15:27:53Z")

</div>

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.

> [@Comments Jump from one topic to another; paid app](https://community.glideapps.com/t/comments-jump-from-one-topic-to-another-paid-app/10564):
>
> My app’s URL: [app.oylchallenge.com](http://app.oylchallenge.com) (fixed the typo) I have 100 people in 2 challenges right now. They post something and comment. However some comments show properly other comment jump to unrelated posts. How is this possible?

---

<div class="post-metadata">

### Author: ![Darren\_Murphy](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/darren_murphy/32/47326_2.png) [@Darren\_Murphy](https://community.glideapps.com/u/Darren_Murphy)
#### Post date: [August 24, 2020, 3:55pm UTC](https://community.glideapps.com/t/favourites-changing-when-rows-reordered/14573/5 "2020-08-24T15:55:45Z")

</div>

Hi Jeff,

> [@Jeff\_Hager](#):
>
> 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.

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

> [@Jeff\_Hager](#):
>
> 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.

My actual application is a Golf Sweepstakes leaderboard. It’s also published from within GSheets - you can see what it looks like [here](https://docs.google.com/spreadsheets/d/e/2PACX-1vR6LDzGTvU_vAJ4ywdbOkA_PD3KliTYCvOHeRI2yvEw4B8AAXqlEuTQ9PLHFBelyx16PvdS3L2yGjPG/pubhtml). 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

---

<div class="post-metadata">

### Author: ![Jeff\_Hager](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/jeff_hager/32/43_2.png) [@Jeff\_Hager](https://community.glideapps.com/u/Jeff_Hager)
#### Post date: [August 25, 2020, 1:40am UTC](https://community.glideapps.com/t/favourites-changing-when-rows-reordered/14573/6 "2020-08-25T01:40:50Z")

</div>

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](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/2X/8/83780ebfd2bf4bce3aba546c3dcfd88c26e6337d.png)

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.

---

<div class="post-metadata">

### Author: ![Mark](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/mark/32/125_2.png) [@Mark](https://community.glideapps.com/u/Mark)
#### Post date: [August 25, 2020, 2:05am UTC](https://community.glideapps.com/t/favourites-changing-when-rows-reordered/14573/7 "2020-08-25T02:05:01Z")

</div>

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.
