Hi,

I am currently trying to create a feature where users can bookmark a listing they want. Upon bookmarking, that bookmarked listing will appear in a second screen. This feature needs to be personalised, which means user 1's bookmarked listings will not be the same as user 2's bookmarked listings. 

I tried the 2 methods (as explained below), but it does not fully achieve what i want. Is there anyone with ideas on how to achieve the feature as explained above? 

Method 1: I tried to do this by adding a new boolean attribute "IsBookmarked" in my "Listings" entity in database. I managed to use the correct logic such that when users clicking on an icon, it will bookmark that listing (so the IsBookmarked is assigned to True). In the second screen, i filter listings which IsBookmarked = True. However, i realised a big mistake which is that my method will result in listings to be permanently bookmarked when one user click on that icon. When another user use the app, the listings bookmarked by the first user will be seen by the second user (which is not correct). It is not personalised. 

Method 2: In order to make it personalised, i tried another method. I tried to add an attribute in the GetListings on that screen itself, IsBookmarked. However, this does not allow me to filter for bookmarked listings in the second screen as this added attribute is only applicable in the first screen. 

Thank you for reading, any ideas and help is very much appreciated!

Hi! You have here a "text book" case of a link many-to-many between two entities, "Listings" entity and "users" entity

You'll need to create another entity to link the "Listings" Id from the marked list and the User Id that marked it. 

Something like this

Hope this Help. Stay Safe


Maria da Graça Peixoto wrote:

Hi! You have here a "text book" case of a link many-to-many between two entities, "Listings" entity and "users" entity

You'll need to create another entity to link the "Listings" Id from the marked list and the User Id that marked it. 

Something like this

Hope this Help. Stay Safe


Hi Maria,

Thanks for the suggestion. But i have some problems. I tried to implement it in my app but it does not work like how its suppose to. I have attached an oml of my attempt. 

Whenever i click on the icon, it saves that listing correctly (as it is seen in the saved listing page). But when i return from the saved listing page to the listing page, the icon becomes unshaded (when it is suppose to remain shaded). 

I also want to include the same icons (both unshaded and shaded) in the saved listings screen, so that users will be able to unsave saved listings as well. But I have issues with the if condition for displaying the shaded/unshaded icons for each listing. 

Maybe you can help to see where the issue lie? 

Thank you.

Hi Jolene.

You only need one query.

If you join Item and Saved, the list will show all Items and if SavedListing is null you know it was not saved.


Hi! 

There are a lot of ways to do what you want but I think this is the easiest. 

Use the SavedListings and the Item entities in the same aggregate to have a list the shows the correspondent records, when they exist, in the same line and use this aggregate as source of the screen 

Please see the oml I send and analyze the new aggregate joins and filters. 

Hope this helps

Graça