Let each user mark his favourite items from menu

I’ve got a sheet that has the menu, and a users sheet.
I want to make a new feature in my app.
I want to let user press a button or something like ‘Add to favourites’, and I want that specific item from the menu that the user added to his favourites, to be shown in his favourites column tab in Users. Im pretty sure that I need a ‘relation column’ in users sheet, but im not sure how to do it.
If anyone can help me I would appreciate.
Thanks in advance.

You could use the built in favorites feature, which adds a column ‘isFavorite’, which is user specific.

All you should need is the user sheet is a template column with the word ‘true’ and then create a relation column that uses template column and links it to the favorite column in the menu sheet. That will bring all the favorited rows into the user sheet and you can display them with an inline list pointing to the relation

Or for simplicity, just add an inline list to the user screen that points to the menu sheet and add a filter where the isFavorite column is ‘true’.

3 Likes

Is this something inside the app? I mean should I tick something for that?

Do you mean this?
https://docs.glideapps.com/all/reference/components/buttons/favorite

I Have this.

Can you explain better these 2 columns that you are saying? I understand something like this:
image

Yes, then you can create a relation pointing this “true” column to the “isFavorited?” column in the destination sheet.

1 Like

But thats a column that has everywhere true. Do I have to do something in the ‘replacemets’ below? At the template

image

image

image

image

It seems like it added that for all of the users. not for a specific user

It may look like it’s for all users, but the experience will be unique for each user. isFavorite is a user specific column. It should work just fine if you preview as different users.

2 Likes

Thank you very much. If anyone need to do the same, you can follow the instructions. It worked for me.
Thanks.

1 Like

@Jeff_Hager @ThinhDinh

Ive got a menu like this, and I want to make a new list, where the user can choose multiple products. So can I do it the way I did this topic?

What do you plan to do with the list afterwards? Is it like a cart?

Its like a page where the information of the user is sent to me via email. It is just a form. But I need to have the product that he ordered in this form too. I have to have column in the Users sheet that has the order. The order is from the menu sheet.

I mean its already done for only ONE product. Its like this:

image

Might be worth checking this out.

Ive seen this before, so what is written in this ‘Blank’ sheet has to be written in my Users sheet?

The only thing that’s really written to the Blank sheet is the unique id when the Clear button is clicked. This could be a User sheet if you wanted, or whichever sheet makes sense for your app’s flow. That unique id is brought into the task sheet using the single value column. Then whenever an item is clicked, it writes the unique id from the single value column to the selected column in the task sheet. If both ID’s match, then the item is selected. If they don’t match, then then the item is not selected. The relation and joined list in the blank sheet just pulls in the selected items from the task sheet.

2 Likes

Mr @Jeff_Hager can you explain a little more all these? And also, how is the parent ID generated? It is a text column, I didnt undestand it.

If you look at the action for the Clear button, as well as the Start button, you will see that I am using a set Column action to write a Unique ID to the Blank sheet

https://docs.glideapps.com/all/reference/values/special-values/unique-identifier

Clicking on a list item is a custom action as also uses the Set Column action to copy the Single Column value (taken from the Blank sheet) in the task to the Selected column, or it clears it.

Looking closely at the Actions should hopefully explain most of it.

So I need this

image

To be at the Users sheet? So it is different for each user?

Yes. Every time a Unique ID is generated, it is always a different unique value. The user will need to do something in the app where you can call a set column action to set that unique id. If that happens to be the user sheet, then yes, you can have that unique id on each user row. If it’s a different sheet, then that generated unique id can be placed into a user specific column in a single row, just like my example.

Like I said. Which sheet you do that in all depends on whatever makes logical sense in your app. I don’t know how your app works, so it’s hard to say for sure.