Favorite Component

 | Part 

8

PREVIOUSNEXT
Copy the finished template here!

Adding the Favorites component lets users set favorites in your app.

Per user data

Favorites relies on per user data, so if your app already asks users to log in to view it, favorites will work fine, as Glide will recognise them by the email they used to log in.

If your app doesn't use login functionality and a user tries to use the favorites feature, Glide will prompt them to log in with a pin.

Glide prompting the unknown user to sign in
The email a user receives from your app

Setting the favorite key

The Key property on the Favorite component is where Glide identifies the exact item that the user is favoriting. This needs to be a unique value in a row.

In our podcast example, the unique value that I would want Glide to match favorites on would probably be the Episode Number as no episode will ever share an episode number with another.

If you don't set a unique key, favorites will still work, but Glide will use cell locations (A1, B3, F7 etc...). So if you add or delete columns or rows, your favorites will be wrong.

By using a unique Key, if I add or delete rows in future, Glide will always be able to match any favorites without getting confused.

Listen to Mark explain this in detail during one of our Glide Togethers

PREVIOUSNEXT