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 / Create a login in scre...
Power Apps
Unanswered

Create a login in screen with password ONLY

(0) ShareShare
ReportReport
Posted on by 102

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})

 

Categories:
I have the same question (0)
  • v-qiaqi@microsoft.com Profile Picture
    on at

    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

  • SunshineK Profile Picture
    102 on at

    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 Profile Picture
    102 on at

    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?

     

  • Verified answer
    v-qiaqi@microsoft.com Profile Picture
    on at

    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

  • SunshineK Profile Picture
    102 on at

    thank you so much. This worked!! 

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

  • v-qiaqi@microsoft.com Profile Picture
    on at

    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

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