Have you ever thought about how to update a rating column in SharePoint using API?

SharePoint includes many commonly known column types, such as single line of text, date, person, etc. Some of these are more complex, but the Rating column is a really interesting example. It gathers ratings from multiple users and displays an average score for each item.

Rating Column

Each list can have only one unique rating-type column.

Since this is not a standard column type you need to use a special endpoint to create it.


How to Create a Rating Column

Here is an example of how to add a Rating column using a Power Automate flow:


Replace contoso, siteName, and listId with your values.

URL:

 https://<<contoso>>.sharepoint.com/sites/<<siteName>>/_api/Microsoft.SharePoint.Portal.RatingSettings.SetListRating(listID=@a1,ratingType=@a2)?@a1=%27<<listId>>%27&@a2=1

Body:

{
}

Usage

Again as the Rating column is not a standard column type, you need to use a special endpoint SetRating to update it.

SetRating

Example of How to Rate an Item in a Power Automate Flow:


Replace contoso, siteName, listId, itemId, and the 1 to 5 value of rating with your values.

URL:

 https://<<contoso>>.sharepoint.com/sites/<<siteName>>/_api/Microsoft.Office.Server.ReputationModel.Reputation.SetRating(listID=@a1,itemID=@a2,rating=@a3)?@a1=%27<<listId>>%27&@a2=%27<<itemId>>%27&@a3=<<rating>>

Body:

{
}

An example of result:

{
  "d": {
    "SetListRating" : 1
  }
}

The column is a great way to collect feedback from users for each item. Since we can collect multiple ratings for one item, there is no need to create another list or table to gather opinions in simple cases.