Hi Guys I was wondering how to create a star rating system? I already have the star rating plugin and also created a “rating” field in my data. But I want to make a formula so that the displayed rating score will be the AVERAGE of the score given, instead of the LAST SCORE given to it. Anyone know how to do that? Thanks a lot!
Create a rating entity that has two fields, user and value. Save estimates from each user, and deduce the average value from the sample by user.
You can use a variety of ways to do this…one that might be most efficient is to create a recurring workflow or api workflow that will automatically (based on your settings) go into your database and calculate the averages for you, maybe once a day at a non-peak time.
To do it, you’d need to have a data field in your data type (restaurant/hotel…whatever the ratings are for) that would be “rating average”.
In your recurring workflow or api workflow you need to create the math around taking the average.
Doing it like this would eliminate some latency on retrieval of the average rating as it would be a data field.
Alternatively, if you want to just do the calculation when the page is loaded, you could create a formula where you search for all of the ratings for the particular entity and use the built in average calculation
Make sure the data fields for ratings are set to number to be able to access the built in math formulas.
This topic was automatically closed after 70 days. New replies are no longer allowed.