Hi @Anonymous,
A few smaller issues before I look at the formula as a whole:
Looking at your existing code, the first thing to mention is the LookUp() function. The syntax for LookUp() is LookUp(DataSource, Condition, Result)
This section:
LookUp('[dbo].[vEmployees]',Type= "Student",
Is missing a Result and needs to be closed with ) before moving on to the If-true statement.
Secondly, there is a function, Switch(), which is great for replacing nested If statements. The syntax is Switch(switch_value, match_value, match_result, ..., default_value). To explain this in real terms, you may have something like Switch(true, variable1 > 10, "Variable is greater than 10", variable > 5, "Variable is greater than 5", "Variable is not greater than 5")
This is a rather simple example, but it shows how you can set an initial switch value, and then each of the match values compare to that switch value and return the match result if true. Bear in mind, the Switch function always returns the first result that matches.
Switch is easier to maintain than mulitple Ifs, and you can have as many conditions as you want.
Now assuming I have this correct and the user types their name (or identifying text) into the TextInput1 and then presses a button to submit, I will try to provide 2 examples of solutions. Unfortunately, I do not quite understand the configuration of your data to solve the opened LookUp functions but I will try.
If(
Text(TextInput1) in '[dbo].[vStudents]'.Email && LookUp('[dbo].[vEmployees]',Text(TextInput1) in Email, Type) = "Student", Navigate(HomeScreen_Trainee,ScreenTransition.None),
If(
Text(TextInput1) in '[dbo].[vTeacherCourses]'.Email && LookUp('[dbo].[vEmployees]',Text(TextInput1) in Email, Type)= "Teacher", Navigate(HomeScreen_Instructor,ScreenTransition.None),Notify("The employee entered is not in the database, NotificationType.Error));
Switch(LookUp('[dbo].[vEmployees]',Text(TextInput1) in Email, Type), "Student", Navigate(HomeScreen_Trainee, ScreenTransition.None),Notify("This student is not found in the database", NotificationType.Error)) , "Teacher", If(TextInput1.Text in '[dbo].[vTeacherCourses]'.Email,Navigate(HomeScreen_Instructor,ScreenTransition.None),Notify("The teacher entered is not in the database", NotificationType.Error)))
I hope this makes sense. Feel free to message me you need more help or ask to clarify anything within my post.