Filter/search users by rating

Hi everyone,
I have an issue with the searching and filtering functionality in my app. There are several registered users and I want to enable searching for one with a filter by their rating. For the rating I’m using a star rating plugin which manages a rating data type with a value (number), created by user and given to user parameters. The user data type has a rating parameter as list of ratings.
The star rating works great, a user’s input and the average for the rated user is working.
However, the star rating input is currently not feeding info to the rating parameter of the user. So the filter funcionality is not showing anything as all users don’t have the data. Can someone help me get the workflow right on how the star rating input should feed the user’s rating? I believe I need to make changes to a user but I get an error. I will leave some pictures for an overview.
Many thanks in advance!






Wouldn’t it make more sense to stop the User rating as a number?

Then just search for Users who’s rating is the selected rating (or within a range of it).

You definitely shouldn’t store a List of ratings on the User, if that’s what you’re doing.

Hi Adam,
thank you for your message! I changed the user’s rating parameter to number as you suggest. However I keep a data type rating with a list of all ratings of all users who voted in order to get an average in the star rating. My issue is how to connect this average amount to the user’s rating paramter.
Best
Yuliya

Whenever a new rating is added, just update the User’s overall rating with the average of all ratings’ values for that user.

I’d probably use a database trigger for that.

Hi,
I’m not familiar with the database triggers and I see I need a growth plan to have this available. I will definately test it once I change my plan. Many thanks!
Best
Yuliya

I don’t know where you’ve seen that, but that’s definitely not true.

Database triggers are available (as are all types of backend workflow) on any paid plan.

But you don’t have to use database triggers for this (it’s just probably the easiest way), you could do it directly in any workflow where new ratings are added (privacy rules permitting).

I’m still using a free plan.
However I managed to change the workflow so now it’s working :slight_smile: Thank you for your help!

1 Like