Forum Academy Marketplace Showcase Pricing Features

Favorite System

Hello!

I want to create a favorite system like AirBNB. If i like a house, its saved for later and then displayed on a MY FAVORITES section. I looked through the forum but found nothing.

Thank you!

2 Likes

As with most things, you can do this in multiple ways. One way is to create a data type called favorite and associate the user and listing to it. Another way is to create a list of listings on the user data type and add/remove items there. I suggest the first as it inherently stores when each listing was added/removed.

That where i lost it… how do i make the association between the Favorite thing and the user?

Assuming you have a Favorite data type, when a favorite is created, you can see the “Created by” field for the user who favorited the listing.

Perfect thank you so much.

Another thing:

I created a button on the profiles page that when you click it, it saves the current profile to the users favorites list. I created a Repeating Group to display all profiles Favorited by the current user.

The only missing part of the puzzle is how to change the workflow and appearance of the button once is click by a user.

Example:

You enter the profile and the FAVORITE button is RED and the workflow when click is to create a new thing (favorite).

When the user clicks the button, i want to change the button to another color and if clicked, run a workflow that deletes the current profile from the users favorites.

How can i accomplish this?

Oh and also how can i display how many times the current profile has been Favorited?

Set a condition on the button and update the style when the profile is a favorite of the user. Also in the workflow, check to see if the profile is currently favorited or not. You’ll need two separate workflows to handle the case when the profile is not favorited and when the profile is already favorited.

Perform a search for favorites for that profile and return the count of the list.

2 Likes

Do you use a Repeating Group to show the favorited listings?

1 Like

Yup, a repeating group where the source of objects is constrained to those that have been favorited.

I created a separate page to show the Favorited listings with a Repeating Group. Now, I have a Star icon that will cause the action of favoriting the listing. How do I get that to work? The workflow for the star (The Favoriting button) that I have is set up as
Make Changes To Listing > Favorited = Group Listing’s Listing’s Favorited is No
and the button isn’t sending the listing to the “Favorites” page I have.