I’m using a Bootstrap Star Rating Plugin to rate elements in my database. I made the workflow that updates the field (list) in the database to store ratings entered by the users.
I wanted to show the average of ratings, but the database store sonly unique ratings. I cannot store two 4s or two 3s. Do you know how to make the database to store all ratings?
Well it seems like what you did is right. You now have a list of ratings, which are number. So you can display/use, for instance, star-rating’s average, etc.
See what I mean?
You are right, I have a list of ratings and I’m going to show the average.
However I can save each particular rate (e.g. 4) only once. This means that if 3 different people give the rating 4 it’ll be saved only once, when the first person gave the rating. The list takes only unique values. So all in all I’ll get the average exactly in the middle of the scale, when I’ll collect all possible ratings.
I think I should be able to save a constant stream of ratings. After some time it should be something like: 2, 3, 1, 3, 3.5, 2, 2, 3, 4, 1, 3, 3, 4, 3 and so on. This way I’d be able to have a average of real ratings that people give to each element.
Right, we don’t support doubles in lists for some database reasons. We’ll fix that at some point, but at this stage a work around is to define a new type of thing ‘rating’ and have the list be a list of ratings instead of a list of numbers. The type rating should have one field of type number ‘value’.
Then you can do “Case’s rating’s value:average”, etc.
Why can’t use just store the number?
You can use the “Star Rating” element, disable the input, and use the average as Initial Content.
Have the ratings as a list of numbers and do the average on that.
Hi @emmanuel, wanted to check again about this - can lists now store the same value more than once, in the way that Pawel wanted to?
No worries if not yet, just wanted to check!
Yeah there hasn’t been any change here.