Need help with service rating expression (formular)

I am developing an App that rates services. Have data type service and field “service score” which is numbers. I have provided a dropdown of numbers 1 – 10 from which users select to score a service. I want the rating to display the average score e.g if only one user rates a service and the user selects 8, 8 will be displayed as rating in the repeating group “RG_Rating”. On the other hand, if 2 users rate the service and one of the users selects 8 and the other one selects 7, the rating will be: 8+7/2 = 7.5. I was thinking that an expression like this could work " RG_rating list of services each service score: sum / RG_rating list of services: count". But the system doesn’t provide me possibility to sum RG_rating list of services each service score as above. Any help with an expression that would work will be greatly appreciated.

That should work

Is your rating field of type number?

Thanks for your swift response boston85719. Yes the rating field is of type number

There must be something wrong in your setup because the expression you described should work as it does in my app




Thank you so much, it works now. I didn’t set the rating score as number