Favorite liste in thunkable

Hello community how i can add favorite liste in thunkable for exemple when user click on
“ADD TO FAVORITE” button , pictures will be added in favorite liste

That wouuld depend on how you are storing the related images.

Usually, a user object may have a field on it which contains all of the users favorite images database unique id’s. you could then retrieve all items by id (slower, but potentially easier to implement than the second option)

alternatively, you could have a table of “favorites” that has fields for a reference to the user and to the image they ‘favorited’

i dont understand sir , do u have any exemple for this so i can use it

I think he meant about having favorites lists with assets used in Thunkable as developer, to use those later for other apps. I guess… :thinking:
From my beginner knowledge, this isn’t possible in Thunkable.

If you are talking about ‘favoriting’ something like in a social networking app,

usually there are several tables, take the following for example.


User
- name
- avatar/image
- age
- email
- userID

Product
- Product Title
- Product Description Body
- Product Price
- product category
- Creation Time
- Creator's userID
- unique record ID

Liked Products
- post record ID
- userID (person who liked the content)

A user may create product postings,

All other users could Poll the Products table by category to return a filtered list. During that data call, the DB could also call out to the likes table and return an aggregate of likes for each product so that when products are displayed, you could display them by the number of likes they have recieved and could even sort with this value as well.

Then, the user could go to his likes/following page, and when the polls the Likes table, he would query against his own userID. that would return a list of all likes BUT before returning the data, you could get the related info from the products table for each unique product ID and return all info about the users list of preferred products

[Edit]
1 alternative may be this where the products are stored on the user as a list BUT this can get heavy and isn’t always performant when it’s a list of objects, however, storing a list of references may be easier but still not likely as performant when using a relational database.

That said, it’d be good for a DB like firebase most liekly


User
- name
- avatar/image
- age
- email
- userID
- Liked Products 
|- product record ID 1
|- product record ID 2
|- product record ID 3


Product
- Product Title
- Product Description Body
- Product Price
- product category
- Creation Time
- Creator's userID
- unique record ID

i mean for exemple we have 10 products in the application ; in every product we have a favorite button , it mean when user click on favorite button this product will be added in favorite liste , so user can keep this products in favorite liste

soemthing like this

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.