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 / Dialpad buttons to cre...
Power Apps
Unanswered

Dialpad buttons to create a code to unlock door

(1) ShareShare
ReportReport
Posted on by 2
Hello,
 
I am trying to built a Powerapp that contains a Dial Pad (behind each number there is a button).
when the users click on these buttons, it will form a CODE of 3 digits (unlock code).
if it is the correct code (ex: 237) a green button will appear.
if the user enters any wrong combination a red button appears, rest, and the user will have to retry again.
any idea how to use variables and buttons in power app to implement this application?
screenshot attached
 
Thanks
Regards
 
 
Categories:
I have the same question (0)
  • WarrenBelz Profile Picture
    153,079 Most Valuable Professional on at
    I got a model working - you may need to adjust some of this - firstly you need to initialise everything - Screen OnVisible would be a good place
    UpdateContext(
       {
          varOKCode: "356",
          varCode: Blank(),
          varTryNo: 0
       }
    )
    then OnSelect of each of the buttons - I am assuming here the Text property is the number.
    UpdateContext({varCode: varCode & Self.Text});
    If(
       Len(varCode) = 3,
       If(
          varCode = varOKCode,
          Navigate(YourNextScreen),
          If(
             varTryNo > 2,
             Notify("Too many attempts"),
             Notify("Try Again");
             UpdateContext(
                {
                   varCode: Blank(),
                   varTryNo: varTryNo + 1
                }
             )
          )
       )
    )
     
    Please click Does this answer your question 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 a Like.
    MVP (Business Applications)     Visit my blog Practical Power Apps    Buy me a coffee

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