web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / How to gather multiple...
Power Apps
Unanswered

How to gather multiple ratings on same item?

(0) ShareShare
ReportReport
Posted on by 221

I feel like this should be something that happens by default but apparently not.

 

When a user of my app inputs their entry into a rating control, the existing rating is overwritten with his choice. How do I enable a collection of all the ratings given by unique users. I ultimately want to make the rating per item an average, but I first need to collect a series of ratings to create an average off of.

 

Any idea how to accomplish this?

 

Thanks!

Categories:
I have the same question (0)
  • BCBuizer Profile Picture
    22,854 Super User 2026 Season 2 on at

    Hi @Ginko ,

     

    Perhaps consider a separate datasource for ratings: Every time somebody uses the ratings control, a new entry should be submitted there along with any other relevant data such as what was rated and who rated it. With that you can everything you seem to need:

    - disable the rating control for user that have already submitted a rating or overwrite the existing rating for that user

    - calculate the average rating per item

     

    An alternative would be a nested table, but I feel that has the potential to get very complicated.

  • TheRobRush Profile Picture
    11,128 Moderator on at

    If you need it all on same list as the source here is what I would do ( The following example I have just set up in a test powerapps of my own and it works very well.)

     

    Make a choice column in your Sharepoint datasource, set its choices to 1,2,3,4,5, to be safe select allow multiple and allow custom. Should not need that but it doesn't hurt to have them selected as long as you are the one coding the entries and it is only used with powerapps it cant be done wrong.

     

    place the following in OnSelect of a button in your gallery by the rating

     

    ClearCollect(standbyCol,ThisItem.LocalAssignment);
    Collect(standbyCol,{Value:Rating2.Value});
    UpdateIf(MasterSubAreas,ID=ThisItem.ID,{LocalAssignment:standbyCol})

     

    My sharepoint list is MasterSubAreas & LocalAssignment is the column where I have set up a choice column

    This code is placed on a button in the gallery and collects the item, then collects the rating, then updates the original splist items choice column to include both what was there before, and what you have added to it. This gives you a record of every rating submitted for said item in your splist

  • Ginko Profile Picture
    221 on at

    Hi Rob,

     

    This is exactly what I've been scouring the internet for, thank you! I'm currently using a SQL table to hold all of my items data. At inception I put a column in the table for the Rating's and while I am not opposed to using a Sharepoint table in conjunction to store the rating data, I think it would be cleanest to keep the ratings in the same SQL table. 

     

    I get the below error after I've updated all the references in your code to my table/columns names. Is it possible to accomplish what you've provided but through my SQL table? What needs to change in order for your code to function with my table?

     

    Ginko_0-1646682347481.png

     

    Thanks again!

  • TheRobRush Profile Picture
    11,128 Moderator on at

    Your criticalityRating column will need to become some kind of a choices column (I am not sure exactly what is the closest data type in sql, but someone here probably will @timl @WarrenBelz @RandyHayes @Pstork1  maybe?) right now it is a text only column, and what we are passing back to it is a table of choice selections

  • RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @Ginko @TheRobRush 

    I'm a little lost on the goal here.  Are you trying to store a series of ratings in the same record or an average rating?

    It seems that an average of all user ratings was needed from what I read in the first post.

     

    Yes, there is no equivalent to the Choices column in SQL, but this can be handled many different ways.  

    I hesitate to throw anything out until I get a handle on what exactly is needed.

  • Ginko Profile Picture
    221 on at

    @RandyHayes @TheRobRush 

    The goal is ultimately to have an average of all user ratings and it exists as a column within the greater data set (not in its own table). Thinking more about it, I couldn't care less if I retain a list of the values that go into the average 🙂 , just so that the value that hits the tables column is the average of all values submitted in PowerApps.

     

    I tried redoing the table creation with [CriticallityRating] varchar(6) CHECK (CriticallityRating IN ('0','1','2','3','4','5')) but I experienced what Randy mentioned and it got me no closer to a choice equivalent column. Same errors.

     

    I read that 'table' itself can be a data type but I'm too much of a novice to know how to deploy that for a single column. Am I on the right path @RandyHayes

     

    So the two things that need to get nailed down are:

    1. How to create a table column that can contain an average rating of the collected ratings.

    2. How to adapt Rob's function to deliver the data to said column.

  • TheRobRush Profile Picture
    11,128 Moderator on at

    If individual scores over time do not be retained then you can simply have 2 number columns. One of them add the new score to its total, second column add 1 to. This will give you a total score column, and a number of ratings column which at any time you can divide by to get a running average

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 356 Most Valuable Professional

#2
11manish Profile Picture

11manish 225 Super User 2026 Season 2

#3
Mohsin Ali Profile Picture

Mohsin Ali 211

Last 30 days Overall leaderboard