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 / Powerapps how to Vote ...
Power Apps
Unanswered

Powerapps how to Vote on Likes for a Question

(0) ShareShare
ReportReport
Posted on by 158

Hi Team, I was wondering if you can help me?

I am very new to Powerapps - but I was wondering if it was possible to create an app which can allows multiple users to post questions and then allow team members to put a vote on the different questions (e.g. thumps up /Like counts)? Ideally would want the list of questions to be ordered based on the number of likes received.

I have created a basic Sharepoint list which captures Employee Name and Employee Questions.

Thanks, Manny.

Categories:
I have the same question (0)
  • BCLS776 Profile Picture
    8,994 Moderator on at

    If you add one more column to your list, one for Likes (number), you can do that. In your app, you'll make a button that reads the current value of Likes and if your user gives it another vote then you'll increase the number by one. It will look something like:

    Patch(
     mySPList,
     ThisItem,
     {
     Likes: ThisItem.Likes + 1
     }
    )
  • Manny123 Profile Picture
    158 on at

    I have created extra column called Likes (numeric values). But I dont understand the formula or where the button should be. 

    Basically I want users to post questions/ideas and team members to like(vote) on the questions/ideas.

  • BCLS776 Profile Picture
    8,994 Moderator on at

    OK, here's a screenshot of a simple app that counts "likes":

    BCLS776_0-1624334233223.png

    I assume you already have your SP list connected to a gallery, so you can see your list of questions. Place an icon or other image in the first gallery, and in its OnSelect property paste the Patch code I shared earlier. Now, each time you click on the icon, the Likes column for that item increases by 1. To help see this in action, I also put in a label and set its Text property to ThisItem.Likes

     

    How does that work for you?

  • Manny123 Profile Picture
    158 on at

    Hi Thanks for the update. I have created the "Thumps Up" icon into the Gallery and also the "likes". When I copy the code into the icons "On Select" I get an error message: "Name isnt invalid. This identifier isn't recognized".  My SharePoint list is called Vote.  I am using 1 Gallery. I have attached screen shots of my app.

     

  • Verified answer
    BCLS776 Profile Picture
    8,994 Moderator on at

    Replace "mySPList" above with the name of your list (Vote) and the error should go away.

  • Manny123 Profile Picture
    158 on at

    Brilliant. It worked! Thank you so much! 🙂

     

    Is there a way to do a filter so the questions with most "likes" are at the top?

     

    Thanks again!

  • Manny123 Profile Picture
    158 on at

    Forgot to mention - At the moment the sort is done using the following formula: 

     

    SortByColumns(Filter([@Vote], StartsWith(Title, TextSearchBox1.Text)), "Title", If(SortDescending1, Descending, Ascending))

  • Manny123 Profile Picture
    158 on at

    Sorry also is there a way so a team member can only vote once per question? i.e. can only click on Thumps up like once per question.

  • BCLS776 Profile Picture
    8,994 Moderator on at

    @Manny123 wrote:

    Forgot to mention - At the moment the sort is done using the following formula: 

     

    SortByColumns(Filter([@Vote], StartsWith(Title, TextSearchBox1.Text)), "Title", If(SortDescending1, Descending, Ascending))


    Your current statement is a combination searching function and sorting function. If you make this one change, it will start sorting by Likes, while keeping the searching function intact:

    SortByColumns(Filter([@Vote], StartsWith(Title, TextSearchBox1.Text)), "Likes", If(SortDescending1, Descending, Ascending))
  • BCLS776 Profile Picture
    8,994 Moderator on at

    @Manny123 wrote:

    Sorry also is there a way so a team member can only vote once per question? i.e. can only click on Thumps up like once per question.


    There are a few ways to do this, and all involve making the Patch available once to the user. You can limit them to one vote per app session by setting a true/false variable and making the Patch conditional on that variable. If you want them to have only one vote ever on that question, that might best be handled with a new table that records their votes against all questions. Then, lookup that table for an existing response before allowing them to patch a like a for a question. 

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 717 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 329 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard