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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / How to add a like and ...
Power Apps
Answered

How to add a like and unlike button using images

(1) ShareShare
ReportReport
Posted on by 78
I have a Power App that displays videos from a document library which has an image to "like" a video and another image to "unlike" a video. I'm trying to use the Patch function to amend the user's email to the "Like" column I added to the document library. The Like column is a multi-select Person or Group column. 
 
 
 
This is the formula I have for the OnSelect function of the Like button, which is the outlined heart image : 
Patch(
 DocumentLibraryName,
 galVideos,
 {
 Like: Ungroup(
 Table(
 {
 Items: [
 {
 DisplayName: "",
 Claims: "i:0#.f|membership|" & User().Email,
 Department: "",
 Email: User().Email,
 JobTitle: "",
 Picture: ""
 }
 ]
 },
 {
 Items: galVideos.Selected.'Modified By'.Claims
 }
 ),
 "Items"
 )
 }
)
 
Here are screenshots with the error message:
 
 
 
I was able to create a Like button by formatting a view instead of using a Power App so I'm assuming having a Like button in a Power App is also possible. 
 
Categories:
I have the same question (0)
  • Michael E. Gernaey Profile Picture
    53,369 Super User 2025 Season 2 on at
    HI
     
    I am sorry I cannot read that and making it bigger just makes it blurrier.
     
    You said that when someone does a link, you wanted to append the users email, but the field is not a string, its a multi-person.
     
    So if 10 people like the same video, you want to update the column with the currently liked people and add the new person correct?
  • 1815 Profile Picture
    78 on at
    Hi Michael, sorry, I've tried adjusting the size of the image and attached them to the post as well. You are correct, I'd like to update the column with the currently liked people and add the new person. I would also like to update the column to remove the new person if they already liked the video. 
  • Verified answer
    Michael E. Gernaey Profile Picture
    53,369 Super User 2025 Season 2 on at
    HI,
     
    Sorry for the delay, I do not have my site up right now as its all being redone, so I will have a couple of links that will explain. Primarily keep in mind, you need to create an Array of Claims (with their email)
     
    And you have existing people in it, so you will have to grab those existing people (via the dynamic property) and turn that list of claim: emails into an array, then you need to add the new people (or remove existing) to that array and then patch it.
     
     
    Please let me know if you have any questions, but its honestly pretty straight forward, its just annoying lol to have to do it

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 721 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 320 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard