cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
SunshineK
Helper II
Helper II

Create a login in screen with password ONLY

Hi Team - as subject states: I want to create a login in screen with a password ONLY to access the other screens.

If the password is incorrect I want to have a text popup that says 'Try Again' or 'Contact Us'.

However I am a little bit lost and need some input please. 

 

SunshineK_0-1622690640910.png

 

My Onselect for my login button: 

 

If('password'.text = "1234",

Reset('password');

UpdateContext({PopUp:false]);

Navigate(ScreenHome)

 

If('password'.text = "summeriscool",

Reset('password');

UpdateContext({PopUp:false]);

Navigate(ScreenHome)

UpdateContext

({

    Message Text: Incorrect. Try again.",

    BadPasswordCount: Sum(Value(BadPasswordCount),1),

    {);

    Reset(password input)

);

 

If(BadPasswordCount = 3)

UpdateContext({PopUp:true})

 

1 ACCEPTED SOLUTION

Accepted Solutions

Hi @SunshineK,

Could you please tell me that if the data type of the password in the Table1 in Text type?

Also, tell me that "&" operation means what, do you want to combine the strings with "&"? I want to explain to you that the "&" is an operator used to combine with two strings, but the formula in your scenario turns that there are two different conditions rather than two strings, so please replace the "&" with "&&" which means the "And".

Hope it could help.

Regards,

Qi

Best Regards,
Qi

View solution in original post

6 REPLIES 6
v-qiaqi-msft
Community Support
Community Support

Hi @SunshineK,

Could you please share a bit more about the scenario, where do you set the variable MessageText and BadPasswordCount?

Please share more details about your configuration

From now on, I could help you modify a little bit as below:

If(
    'password'.Text = "1234",
    Reset('password');
    UpdateContext({PopUp: false});
    Navigate(ScreenHome),
    If(
        'password'.Text = "summeriscool",
        Reset('password');
        UpdateContext({PopUp: false});
        Navigate(ScreenHome),
        UpdateContext(
            {
                MessageText: " Incorrect. Try again.",
                BadPasswordCount: Sum(Value(BadPasswordCount.Text),1)
            }
        );
        Reset(BadPasswordCount),
        If(
            Value(BadPasswordCount.Text) = 3,
            UpdateContext({PopUp: true})
        )
    )
)

Check if this could help you.

Regards,

Qi

Best Regards,
Qi

Whoops - I probably shouldn't have two passwords. 

 

So basically how I want it to work is when you open the app it asks the user to fill in a password, and then have a login button. 

 

If the password is correct - it will take you to the home screen. 

If the password is incorrect - it has a pop up on the login screen that says 'Incorrect Password' for 5 seconds.

If the password has been entered incorrect 3 times - it has a pop up on the login screen that says 'contact us' or 'try again'. 

SunshineK
Helper II
Helper II

Hi Team - I have tried a different way ... only one error this time which is good.

 

SunshineK_0-1623366712488.png

SunshineK_1-1623366729493.png

 

password input format is 'Text'. 

 

When I click the login button it does nothing. 

 

Any suggestions?

 

Hi @SunshineK,

Could you please tell me that if the data type of the password in the Table1 in Text type?

Also, tell me that "&" operation means what, do you want to combine the strings with "&"? I want to explain to you that the "&" is an operator used to combine with two strings, but the formula in your scenario turns that there are two different conditions rather than two strings, so please replace the "&" with "&&" which means the "And".

Hope it could help.

Regards,

Qi

Best Regards,
Qi

View solution in original post

thank you so much. This worked!! 

if I was to have the password as numbers - how would I make that work?

Hi @SunshineK,

If you have used the correct operator but have type of number, you should format the Username.Text as Value(Username.Text).

Only need to format the text string using the Value() function.

Regards,

Qi

Best Regards,
Qi

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Welcome Super Users.jpg

Super User Season 2

Congratulations, the new Super User Season 2 for 2021 has started!

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Users online (978)