cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
New Member

Like/Unlike a SharePoint List Item

Hello,

I have a custom list in SharePoint Online with the rating activated.

In my PowerApp, I have a button to like/unlike an item.

The property available for the like/unlike is "LikedBy" which is a list of Claims Users.

With this code, I can add/remove the current user to/from the list which simulate the like/unlike.

  

If(IsBlank(First(Search(LikedBy, "i:0#.f|membership|" & Lower(User().Email), "Claims"))), UpdateIf(Improvements, Title = Title, {LikedBy:Collect(LikedBy, {'@odata.type':"#Microsoft.Azure.Connectors.SharePoint.SPListExpandedUser",Claims:"i:0#.f|membership|" & Lower(User().Email),Department:"", DisplayName:User().FullName,Email:User().Email,JobTitle:".",Picture:User().Image})}), UpdateIf(Improvements, Title = Title, {LikedBy:RemoveIf(LikedBy, Claims = ("i:0#.f|membership|" & Lower(User().Email)))}))

 

It works well in term of considering that the item is liked or unliked.

The problem is that the Number of likes is not updated.

  

I can see in different articles that there is another property called "LikesCount" but it is not available here.

 

Is there something I missed?

Can you help me please?

Thanks a lot.

 

2 REPLIES 2
Community Support
Community Support

Hi @_fabrice_,

 

Could you please share a bit more about your SharePoint list which has enabled Rating option?

 

I have made a test and the issue is confirmed on my side. The number of likes is not updated within my SharePoint list when I like an item within my PowerApps.

 

In addition, I could not find the LikeCount property within my PowerApps app Form (and SharePoint list). If you want to update the number of likes of an item within your PowerApps app, I afraid that there is no way to achieve your needs in PowerApps currently.

 

If you would like this feature to be added in PowerApps, please submit an idea to PowerApps Ideas Forum:

https://powerusers.microsoft.com/t5/PowerApps-Ideas/idb-p/PowerAppsIdeas

 

Best regards,

Kris

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Advocate I
Advocate I

Hi, did you manage to find a solution to updating the number of likes?

Helpful resources

Announcements
News & Announcements

Community Blog

Stay up tp date on the latest blogs and activities in the community News & Announcements.

Power Apps Community Call

Power Apps Community Call- January

Mark your calendars and join us for the next Power Apps Community Call on January 20th, 8a PST

PP Bootcamp Carousel

Global Power Platform Bootcamp

Dive into the Power Platform stack with hands-on sessions and labs, virtually delivered to you by experts and community leaders.

secondImage

Power Platform Community Conference On Demand

Watch Nick Doelman's session from the 2020 Power Platform Community Conference on demand!

Top Solution Authors
Top Kudoed Authors
Users online (11,813)