0

Is there any way to update a User Ratings column in SharePoint from PowerApps? i.e. so that each unique user gets 1 vote per list item, which they can update?

I've previously asked about fetching data from the User Ratings field; allowing us to display the average of all users' ratings for a given item. However, there doesn't seem to be information available to PowerApps on which user submitted which rating; so updating this field through PowerApps in an expected manner (each user having control of their rating; but unable to influence other users' ratings) doesn't seem possible.

I've seen a request for this feature from 2017 which is still open, so maybe this isn't possible today; but it could be that the site's out of date, or the question's more vague than this specific requirement so there's a solution out there for this part of the requirement already?

1 Answer 1

0

Just faced this issue today while working with SharePoint Rating columns in PowerApps. It looks like we can only read the rating value but cannot update it.

I found one workaround for this issue, but we need to first change the rating column type from "ratings" to "likes". Here are the remaining steps:

  1. In PowerApps when you connect the SharePoint source you will get some hidden rating columns like "Likedby" which stores the values of claims and related info (people type column) who have liked or rated the SharePoint item.
  2. So, you need to pick this column for every item using "Thisitem.LikedBy".
  3. Then for "Onselect" event of a icon or button (Thumbsup icon which is not filled) , perform a clearcollect(LikedBy_col, Thisitem.LikedBy) and then use patch like this
//  Patch to update the likedby_col collection to add  current user details 

Patch(
        LikedBy_col,
        Defaults(LikedBy_col),
        {
            Claims: "i:0#.f|membership|" & Lower(User().Email),
            Department: "",
            DisplayName: User().FullName,
            Email: User().Email,
            JobTitle: "",
            Picture: ""
        }
    );

//  Patch to update the likedby hidden column of SharePoint with this collection
 Patch(
        <Listname>,
        ThisItem,
        {LikedBy: LikedBy_col
        }
    )

In this way likedby column will get updated in SharePoint list . You can perform a rest call to see the value.

  1. Now you can show the updated number of likes for each item as CountRows(ThisItem.LikedBy) in a label
  2. Change the icon type from thumbsup to thumbsupfilled
  3. now, when user clicks on the filled icon , do the oppsite of step 3 to clear the claims of the current user from the Likedby column

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.