Favorited active Toggle

Hi,
I have an issue with the toggles I use on my product pages to favorite them.
When clicking on the toggle, the product page is saved as fav, however, if I quit the page and come back on it, the toggle is inactive. I tried everything (I guess?): putting the toggle into a list, creating some visibility conditions and so on, but nothing is working.
Am I missing something?

Thanks

Hi @Anne-Sophie,

Could you show your setup and the preview from a video? ( You can use Loom )

Thank you

Hi!

Here’s the link to the Loom : here.

Thanks :slight_smile:

Hi @Anne-Sophie,

Thanks for the video!

Seems like you are creating records for favorites? Could I know why?

And could you show a screenshot of your Places collection?

Thank you

Thanks for the quick answer @dilon_perera
Yes I record the user’s favorite so that he can find them on his favorite screen. But maybe I did it wrong?
And here is a screenshot of the places collection :

At first there wasn’t any relationship between places and favorites. I created one as I was experimenting different things to make the active toggle work but it didn’t change anything.

If you do this in that way you need two icons to show that it’s toggled on and off. This way is easy! : How to Create a Favorite Button - YouTube It’s with a many to many relationship between the Users collection and the Places collection.

Thanks for the tip but I already followed this tutorial and i can’t figure it out. I can’t select the logged in user in the visibility settings :


Maybe this is why it doesn’t work?

You need to select current place > users ( many to many relationship ) > all > contains > logged in user. Also you can connect this many to many relationship property directly to the toggle too!

Hi finally managed to make it work :relieved:
But only if I add the user manually in the database :thinking:


Do you have any idea why users don’t automatically register in the database (if not relevant I can open a new topic)?

Thanks for your help!

Awesome!

Are you using a button or a toggle to do favorite? Toggle right?

That’s right, a toggle!

Did you connect that many to many relationship to the toggle? A screenshot?

I just played with actions and it seems to work now!
Just have an issue with my favorite screen now but I guess I’ll make another post if I can’t figure it out.
Thank you so much for your help @dilon_perera!

Awesome!

Since it’s about the favorites you can post it here too and the community is here to help you :+1:

Also if you can’t figure it out you can give access to that app for this email ( pereradilon24@gmail.com ) and I’ll check that and post the answer here!

( Open the app in the editor > setting icon on the left side > app access section > add the email )

Your welcome!

Thank you so much, it has been so helpful.
My issue with the favorite screen is that when the favorited item is removed from the list, the toggle stays active on the product page. On the other hand, if I unfav the product, it still appears on the favorited screen (which is weird as it used to work :thinking:)

I’ll give you access if you wanna check (just note that I duplicated product pages so that the user can access it when clicking from the favorite screen (Favorited product page), but here I am talking about the first Product page).

Hmm… Need to check this.

If you can that would be great!

Thanks for adding me! Could you check again and let me know? If you have opened the app already in the editor reload the browser and try again.

OMG it works!!!
I can’t thank you enough :sob:

1 Like

Awesome! Your welcome! Now you can remove my email from the app access section.

The problem was you was using two icons so I just removed them and added only a toggle and connected it to the many to many relationship property. And also I added this to other ones too! ( Highlights, Experiences,… )