I have 2 variables set to two lookup functions. If the lookup function tally with the user credentials enters in the text box it navigates to a screen called admin. I want to remove one variable at a successful login and keep only the successful login variable.
If(
IsBlank(LookUp(UserTR, Title = TextInput1.Text And passwordtr = TextInput1_1.Text)),
Notify("User Name & Password Incorrect", NotificationType.Error),
With(
{ userrecord1: LookUp(UserTR, Title = TextInput1.Text And passwordtr = TextInput1_1.Text) },
Switch(
userrecord1.roletr.Value,
"QA", Navigate(AdminScreen),
"mecha", Navigate(AdminScreen),
"BD", Notify("Role not found", NotificationType.Error))
&& Set(ss1,userrecord1.roletr.Value)
)
);
If(
!IsBlank(LookUp(UserL1, Title = TextInput1.Text And passwordl1 = TextInput1_1.Text)),
With(
{ userrecord2: LookUp(UserL1, Title = TextInput1.Text And passwordl1 = TextInput1_1.Text) },
Switch(
userrecord2.rolel1.Value,
"IT", Navigate(AdminScreen),
"HR", Navigate(AdminScreen),
"gh", Notify("Role not found", NotificationType.Error)
) && Set(sss,userrecord2.rolel1.Value)
)
);