
Hi Members,
I had a requirement in Power Apps to create a Power Apps login screen.
I have a SharePoint list [ACGH Login] with three columns:
No. In my Power Apps, I have created a Login screen where users can log in using their Email/Username and password.
But, I was facing some small issues in my code.
If(
IsBlank(txt_Email.Text) && IsBlank(txt_Password.Text),
Set(
var_EmailErrorMsg,
"Enter an Email Address or User Name"
);
Set(
var_PasswordErrorMsg,
"Enter a Password"
),
If(
IsBlank(txt_Email.Text),
Set(
var_EmailErrorMsg,
"Enter an Email Address or User Name"
),
Set(
var_EmailErrorMsg,
""
)
);
If(
IsBlank(txt_Password.Text),
Set(
var_PasswordErrorMsg,
"Enter a Password"
),
Set(
var_PasswordErrorMsg,
""
)
);
If(
IsEmpty(
Filter(
'ACGH Login Details',
Email = txt_Email.Text || Title = txt_Email.Text,
Lower(Title) = Lower(txt_Email.Text)
)
),
Set(
var_EmailErrorMsg,
"Enter a Valid Email or User Name"
),
Set(
var_EmailErrorMsg,
""
);
If(
IsEmpty(
Filter(
'ACGH Login Details',
Email = txt_Email.Text || Title = txt_Email.Text,
Password = txt_Password.Text,
Lower(Password) = Lower(txt_Password.Text)
)
),
Set(
var_PasswordErrorMsg,
"Enter a Valid Password"
),
Set(
var_PasswordErrorMsg,
""
);
Navigate(HomeScreen)
)
)
)
I need to validate when a user enters both an incorrect Email/Username and Password. Both errors should be shown. Currently, the error message only appears near the Email/Username field, and the error is not displayed near the password field.
Can anyone please suggest how I can achieve this? Thanks in advance!
it seems that your filter is not working correctly.
try to change it to this
the first filter
Filter(
pwlist,
Lower(Email) = Lower(txt_Email.Text) || Lower(Title) = Lower(txt_Email.Text)
)
and the second one
Filter(
pwlist,
Lower(Email) = Lower(txt_Email.Text) || Lower(Title) = Lower(txt_Email.Text),
Lower(Password) = Lower(txt_password.Text)
)