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 Platform Community / Forums / Power Apps / Login problem with but...
Power Apps
Answered

Login problem with button conditions

(0) ShareShare
ReportReport
Posted on by 47

kashif18oc_0-1685628177350.png

 

kashif18oc_1-1685628339258.png

 

 

Greetings,

 

My syntax is correct for button : on select statement but it only work for false condition but not true condition.

 

may be its not refreshing or what.

 

Please support

 

 

Categories:
I have the same question (0)
  • BCBuizer Profile Picture
    22,833 Super User 2026 Season 1 on at

    Hi @kashif18oc ,

     

    Use IsBlank instead of IsEmpty.

  • mmollet Profile Picture
    3,187 on at

    Seems like you are saying tho following with your logic:

    If(UN/PW don't Match a row in SP List, navigate to screen, show invalid input error)

    It seems to me that you would want these to be flipped. Try adding a ! right before IsBlank to make it not is blank like this !IsBlank(etc....

     

  • kashif18oc Profile Picture
    47 on at

    The issue is solved with the solution provided,

    but

    after going inside and coming back to the login page again, now even if i type the wrong password or leave blank still it goes inside.

    what is it, is it holding in cache or what?

  • Verified answer
    mmollet Profile Picture
    3,187 on at

    This is due to the logic I believe. The logic you gave is doing the following:

    IsBlank(LookUp(TLESI_UserMasters, UserName = txtUserName_1.Text And Password = txtPassword_1.Text))

    This will return true if it does not find a row that matches the 2 conditions. If it returns true then it will execute:

    Navigate(pgMasterHome, ScreenTransition.Fade)

    The issue, I think, is that you will return true any time the username and password DONT match as well. The lookup returns Blank() when it doesnt find a match which makes IsBlank be true which executes the navigate instead of the error message. 

  • Verified answer
    Ethan_009 Profile Picture
    4,838 Moderator on at

    Hi @kashif18oc ,

     

    Do you face the same issue if you use the following code when you click login?

     

    With(
     {
     PasswordByList: LookUp(TLESI_UserMasteres, UserName = txtUserName_1.Text, ThisRecord.Password),
     PasswordEntered: txtPassword_1.Text
     },
     If(
     IsBlank(PasswordByList),
     Notify("Enter UserName!", NotificationType.Warning, 1000),
     If(
     PasswordByList <> PasswordEntered,
     Notify("Invalid Username/Password!", NotificationType.Error, 1000),
     Navigate(pgMastersHome, ScreenTransition.Fade)
     )
     )
    )

     

     

  • Verified answer
    kashif18oc Profile Picture
    47 on at

    Thanks a lot

  • kashif18oc Profile Picture
    47 on at

    this one also worked, Thanks

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 June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 335 Most Valuable Professional

#2
11manish Profile Picture

11manish 166

#3
sannavajjala87 Profile Picture

sannavajjala87 71 Super User 2026 Season 1

Last 30 days Overall leaderboard