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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Apps
Answered

Voting app

(0) ShareShare
ReportReport
Posted on by 56

Hi all. A beginner here. I'd like to create an app where there's gonna be two button yes or no and the number of clicks for each choice will be shown on the next screen. How shall I do this? Thanks in advance!

Categories:
I have the same question (0)
  • Verified answer
    AndrewR1 Profile Picture
    1,572 Moderator on at

    Hi @catto16 here is some guidance for you to get started! 

    Step 1: Design the First Screen 2. In the first screen (let's call it "ChoiceScreen"), add two buttons: one for "Yes" and one for "No." You can do this by going to the Insert tab and selecting the Button control for each choice.

    1. Rename the buttons to "btnYes" and "btnNo" for clarity. You can do this by selecting the button and changing the Text property in the properties pane.

    2. Add labels or text to indicate the choices if needed.

    Step 2: Create Variables 5. In the app, you need to create two variables to track the number of clicks for each choice. Go to the View tab and select Variables to create two new variables:

    • YesClicks (Type: Integer, Default: 0)
    • NoClicks (Type: Integer, Default: 0)

    Step 3: Configure Button Actions 6. For the "btnYes" button, set its OnSelect property to increment the "YesClicks" variable by 1:

     

     

    Set(YesClicks, YesClicks + 1)

     

     

    Step 4: Create the Second Screen

    8. Add a new screen (let's call it "ResultsScreen") to your app. You can do this by clicking "New Screen" in the left panel.

    1. In this screen, you can use labels or text controls to display the number of clicks for each choice. For example, you can use labels with text properties like this:

      • Label for "Yes" clicks: Text(YesClicks, "0")
      • Label for "No" clicks: Text(NoClicks, "0")

    Step 5: Navigation

    10. You can add a button or other navigation elements to allow users to move from the "ChoiceScreen" to the "ResultsScreen" when they are ready to see the results. Use the Navigate function to transition between screens:

     

     

    Navigate(ResultsScreen, ScreenTransition.Fade)

     

     

    This could also be added to each of the Yes or No buttons at the end of the onSelect if as soon as they have answered you wish to navigate them to the results page.

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.


    Thanks
    Andrew

     

  • catto16 Profile Picture
    56 on at

    Hi @AndrewR1 Thanks for the reply. Let me try it out and update u the progress. Thanks so much!

  • catto16 Profile Picture
    56 on at

    Hi @AndrewR1 , I managed to do it. Thanks for your help. I also managed to get a button to "reset" both counts. 

     

    Set(YesClicks, 0) & Set(Noclicks, 0)

     

    One more thing, could I disable the buttons once it was clicked? I've tried this and this. Both aren't working for me. Whenever I put some formulas on visible, the button just totally disappeared before it was even clicked. 

     

    And I realised when I'm opening the app on my browser and my phone at the same time and clicking it, the numbers aren't synced. The app will be used by a number of users at the same time and the collected numbers are intended to be displayed on the spot. How can I do this?

     

    Thanks a ton!

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 358 Most Valuable Professional

#2
11manish Profile Picture

11manish 214 Super User 2026 Season 2

#3
Mohsin Ali Profile Picture

Mohsin Ali 185

Last 30 days Overall leaderboard