# (New) Star rating (component) implementation | Linked to individual users

**URL:** <https://forum.adalo.com/t/new-star-rating-component-implementation-linked-to-individual-users/10767>\
**Category:** Database\
**Created:** [March 28, 2021, 10:31am UTC](https://forum.adalo.com/t/new-star-rating-component-implementation-linked-to-individual-users/10767 "2021-03-28T10:31:39Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![RisingBuilder](https://avatars.discourse-cdn.com/v4/letter/r/ccd318/32.png) [@RisingBuilder](https://forum.adalo.com/u/RisingBuilder)\
**Post date:** [March 28, 2021, 10:31am UTC](https://forum.adalo.com/t/new-star-rating-component-implementation-linked-to-individual-users/10767/1 "2021-03-28T10:31:39Z")

</div>

I am looking for a way to let users store their individual rating for a specific subject (for example a trip). Everytime they go to the details page of this subject they should be able to see their own rating.

**The app is set up in the following way:**

Home page \> Categories of trips \> Trips \> Trip Details.

In order to achieve my goal I have almost tried all different variations of creating relationships and the one that is most close to the solution is the following:

I created a relationship between the database of the user and the database of the trips.

**Relationship**

A “Trip” can have multiple “Users”.

A “User” belongs to one “Trip”.

After that I placed the new star rating feature (of the market place) on the trip details page, with the following settings:

**Can users set a rating?**

Yes

**What property does this set?**

Logged In User \> _Relation variable that connects “User database collection” to “Trip database collection”_ \> Rating

The outcome of this “code” is that I am able to give different trips different ratings, and the app memorizes these, but then again all users automatically have the same ratings for the same trip. I find this very strange since the above mentioned code starts with “Logged In User”.

Can anybody help, please? I really started to like the Adalo builder but now I do not know what to think.

---

<div class="post-metadata">

**Author:** ![Yongki](https://avatars.discourse-cdn.com/v4/letter/y/7c8e57/32.png) [@Yongki](https://forum.adalo.com/u/Yongki)\
**Post date:** [March 28, 2021, 11:55am UTC](https://forum.adalo.com/t/new-star-rating-component-implementation-linked-to-individual-users/10767/2 "2021-03-28T11:55:24Z")

</div>

Hi @RisingBuilder ,

Take a look at this.

> **[star rating trips](https://previewer.adalo.com/124bf7cc-31c2-450d-bf07-6f49d07fdba6)**
>
> Built with Adalo

username password  
[a@a.com](mailto:a@a.com) a  
[b@b.com](mailto:b@b.com) b  
[c@c.com](mailto:c@c.com) c

delete all records in trip ratings collection first.

UI for debugging purpose  
UX for shortcut purpose

---

<div class="post-metadata">

**Author:** ![RisingBuilder](https://avatars.discourse-cdn.com/v4/letter/r/ccd318/32.png) [@RisingBuilder](https://forum.adalo.com/u/RisingBuilder)\
**Post date:** [March 28, 2021, 11:58am UTC](https://forum.adalo.com/t/new-star-rating-component-implementation-linked-to-individual-users/10767/3 "2021-03-28T11:58:56Z")

</div>

@Yongki thanks for your reply, but I am not looking for an option where you can see the reviewers under the subject.

---

<div class="post-metadata">

**Author:** ![Yongki](https://avatars.discourse-cdn.com/v4/letter/y/7c8e57/32.png) [@Yongki](https://forum.adalo.com/u/Yongki)\
**Post date:** [March 28, 2021, 12:03pm UTC](https://forum.adalo.com/t/new-star-rating-component-implementation-linked-to-individual-users/10767/4 "2021-03-28T12:03:55Z")

</div>

You can play with filters.

---

<div class="post-metadata">

**Author:** ![Victor](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.adalo.com/victor/32/2054_2.png) [@Victor](https://forum.adalo.com/u/Victor)\
**Post date:** [March 28, 2021, 12:12pm UTC](https://forum.adalo.com/t/new-star-rating-component-implementation-linked-to-individual-users/10767/5 "2021-03-28T12:12:56Z")

</div>

Hi @RisingBuilder,

The result you get is pretty logical: you have 1 trip for many users’ relation. So when some user changes the rating for that trip, of course it will be updated for everyone - as this is just 1 trip record 🙂

What I would suggest is having a separate “Trip Reviews” collection:

- relation to Trips m:1. One Trip can have many reviews, but review belongs to a single trip
- relation to Users m:1. One User can have many reviews, but review belongs to one user
- rating itself (Numeric).

Then, when user makes a review for the trip, you need to create a record in this collection, and set a rating. I can imagine something like a Trip screen with button “Review”, which (a) creates the new record for current trip+logged-in user, and then leads user to LeaveReview screen, where you put Star Rating component, which changes Current Review’s rating.

Of course you need to protect against multiple reviews for a single trip from the same user. I’d make it using 2 buttons with visibility conditions - one when review doesn’t exist, and it creates review; another is when review exists and it doesn’t create review but just leads the user to review screen. Use Trip-\>TripReviews-\>Count + filter for logged-in user to set visibility.

As for me, such logic should work.

Best regards, Victor.

---

<div class="post-metadata">

**Author:** ![RisingBuilder](https://avatars.discourse-cdn.com/v4/letter/r/ccd318/32.png) [@RisingBuilder](https://forum.adalo.com/u/RisingBuilder)\
**Post date:** [March 28, 2021, 12:23pm UTC](https://forum.adalo.com/t/new-star-rating-component-implementation-linked-to-individual-users/10767/6 "2021-03-28T12:23:21Z")

</div>

@Victor This makes sense. Thank you for replying.
