Get Pinned/Favourite User Items - Xano

Hi all,

I am trying to display a list of items that a user has selected as favourite.

The User Table is linked to the Items table.

When getting the collection, I used a GET_USER/{user_id} and I used an ADDON for the Item details.

My problem is that I’m not sure how to filter the collection based on the User.id. So that way I only get the items from the loggedin user.

Any ideas?

Hi,
How is the favourite field? Is this a boolean in the Item table?

You need to apply this filter on the frontend?
If on frontend, you can just bring the field “Favourite” in the addon and then filter in Weweb:

If you can filter in the backend and not load all items, only items that are “favourite”, you can always apply this condition directly in the addon:

When you create the addon in the endpoint, this addon is created in the XANO library, there you can edit the addon and apply the query filter to only return items that are favourite.