You seem to misunderstand the If condition in Power Apps
In PowerApss, the syntax of the if condition should be
If( Condition, ThenResult [, DefaultResult ] )
- If the function tests one or more conditions until a true result is found, so
ThenResult
section will be executed.
- If no condition evaluates to true a
DefaultResult
is returned.
- If you don't specify the
DefaultResult
argument, a blank is returned.
So In your case, you have to check if the provided information is correct it should navigate to the Success
screen otherwise, it should do three actions
- Print error message.
- Reset the user name textbox.
- Reset the password textbox
So in your formula, you should use multiple & to perfrom multiple actions in the else section as below :
If(
LookUp(
Login,
Title = txtUserName.Text,
Password = txtPassword.Text
),
Navigate(success), Notify( "Please enter Valid user name and Passwords", NotificationType.Error )&Reset(txtUserName)&Reset(txtPassword))
Output
Nester-IF in PowerApps
If you have multiple conditions, and you would like to use Nested IF in the PowerApps formula, you have to use the below syntax:
If(Condition, ThenResult, condition, ThenResult, condition, ThenResult[, DefaultResult ])
Read more at If and Switch functions in Power Apps