cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
DavidWilson
Level: Powered On

How could you create a pin number input?

Hi All,

 

I'd like to create a screen that looks very similar to ATM where you would input a pin.

 

i.e. you would have number buttons from 1-9 with a zero button below the number in the centre. You would then have a clear button on the left of the zero and and enter button on the right of the zero.

 

Pin: 0000

 

1       2       3

4       5       6

7       8       9

clear 0 enter

 

At the top of the screen you would have a text box showing what numbers you've pressed.

 

How would you setup the onselect and text boxes so that it would concatenate the number you've pressed so that it would appear as a pin being entered at the top.

 

Thanks in advance for all your help.

 

Dave 🙂

1 ACCEPTED SOLUTION

Accepted Solutions
Meneghino
Level 10

Re: How could you create a pin number input?

Start with the clear button OnSelect

Set(MyPin, "")

Button 1 OnSelect:

Set(MyPin, MyPin & "1")

and so for all numbers

 

The label at the top simply shows

"Pin: "&MyPin

You may want to set the DisplayMode property of the number buttons to:

If(Len(MyPin<=4), Edit, Disabled)

And set the DisplayMode of the enter button as:

If(Len(MyPin)=4, Edit, Disabled)

 

View solution in original post

7 REPLIES 7
Meneghino
Level 10

Re: How could you create a pin number input?

Start with the clear button OnSelect

Set(MyPin, "")

Button 1 OnSelect:

Set(MyPin, MyPin & "1")

and so for all numbers

 

The label at the top simply shows

"Pin: "&MyPin

You may want to set the DisplayMode property of the number buttons to:

If(Len(MyPin<=4), Edit, Disabled)

And set the DisplayMode of the enter button as:

If(Len(MyPin)=4, Edit, Disabled)

 

View solution in original post

JRaasumaa
Level 10

Re: How could you create a pin number input?


@DavidWilson wrote:

Hi All,

 

I'd like to create a screen that looks very similar to ATM where you would input a pin.

 

i.e. you would have number buttons from 1-9 with a zero button below the number in the centre. You would then have a clear button on the left of the zero and and enter button on the right of the zero.

 

Pin: 0000

 

1       2       3

4       5       6

7       8       9

clear 0 enter

 

At the top of the screen you would have a text box showing what numbers you've pressed.

 

How would you setup the onselect and text boxes so that it would concatenate the number you've pressed so that it would appear as a pin being entered at the top.

 

Thanks in advance for all your help.

 

Dave 🙂


 

We actually have an in house Time Clock that I built that is very very similar.

 

To add to @Meneghino's ideas we also have a mask field that updates with each button click so I can change the text box at the top of the attached image to show the pin as masked once it's entered.

 

timeclock.png

 

timeclock2.png

 

The "No/Esc" button clears the values by settings them to ""

 

There is also code to check the Length of the entered "pin" to stop users from entering it beyond 5 values.

 

Otherwise it works great, if you have any other questions let me know!

 

DavidWilson
Level: Powered On

Re: How could you create a pin number input?

Thanks so much it works a treat!

DavidWilson
Level: Powered On

Re: How could you create a pin number input?

Hi all,

 

This has worked really well, now I'd like to add to this by adding a table of Users and PIN numbers and be able to identify who has logged in using a PIN.

 

For example: I have a 3 column table Name,Group,PIN With the persons Name which Group within the company they work in such as Sales or Operations with the 3rd column being individual PIN numbers for each.

 

What I'd like to be able to do is after the user has typed in the PIN set a variable to advise which user is currently logged in that I can then use in a Label as well saying who has logged in.

 

So simple Login

 

How I'd Set a Variable with who's logged in.

 

Create a label showing the name of who has logged in using the PIN. 

 

Thanks in advance

 

 

Dave

Meneghino
Level 10

Re: How could you create a pin number input?

IMHO you would be much better off with the User() function and/or the Office365Users connector and using the in-built functionality rather than duplicating it and having your user have to remember yet another PIN/password.

https://docs.microsoft.com/en-us/powerapps/functions/function-user

https://docs.microsoft.com/en-us/powerapps/connections/connection-office365-users

JRaasumaa
Level 10

Re: How could you create a pin number input?


@DavidWilson wrote:

Hi all,

 

This has worked really well, now I'd like to add to this by adding a table of Users and PIN numbers and be able to identify who has logged in using a PIN.

 

For example: I have a 3 column table Name,Group,PIN With the persons Name which Group within the company they work in such as Sales or Operations with the 3rd column being individual PIN numbers for each.

 

What I'd like to be able to do is after the user has typed in the PIN set a variable to advise which user is currently logged in that I can then use in a Label as well saying who has logged in.

 

So simple Login

 

How I'd Set a Variable with who's logged in.

 

Create a label showing the name of who has logged in using the PIN. 

 

Thanks in advance

 

 

Dave


 

If you simply have another column with a true/false for being logged in would that work?

 

Then when they type in their pin if it's found then flip the column to true so you can display they are logged in. We do this but also capture the date/time of every punch in a log so you can see when they last logged in too.

MRFowler
Level: Powered On

Re: How could you create a pin number input?

Can I get a copy of your solution as well?

Helpful resources

Announcements
thirdimage

Power Apps Super User Class of 2020

Check it out!

thirdimage

Power Apps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

SecondImage

Difinity Conference

The largest Power BI, Power Platform, and Data conference in New Zealand

Top Solution Authors
Top Kudoed Authors (Last 30 Days)
Users online (4,809)