Hi @MustafaAlqanbar ,
Could you please share a bit more about the issue on your side?
Do you want to check if current sign in user is a authorized user, if yes, navigate him to the specific screen, if not, navigate to a Auth_404 screen?
Based on the formula you provided, I think you are in right direction. I have made a test on my side, please consider take a try with the following workaround:
Set the OnStart property of App to following:
If(
!IsBlank(Param("ID")),
If(
LookUp(Table_Name, Field_Name = Param("ID"), Field_Name) = Office365Users.MyProfile().Mail,
Navigate(SpecificScreen), /* <-- Navigate to a specific screen */
Navigate(Auth_404) /* <-- Navigate to Auth_404 screen */
)
)
In addition, it is not necessary to add Office 365 Users data source in your app, I think the User() function could achieve your needs. Please consider modify above formula as below:
If(
!IsBlank(Param("ID")),
If(
LookUp(Table_Name, Field_Name = Param("ID"), Field_Name) = User().Email,
Navigate(SpecificScreen), /* <-- Navigate to a specific screen */
Navigate(Auth_404) /* <-- Navigate to Auth_404 screen */
)
)
Actually, you could consider use a data source to store the authorized users, and then add this data source into your app. Then within your app, you could check if the current sign in user is existed in the data source directly. You could set the OnStart property of the App to following:
If(
User().Email in Table_Name.EmailColumn,
Navigate(SpecificScreen),
Navigate(Auth_404)
)
or
If(
User().FullName in Table_Name.DisplayNameColumn,
Navigate(SpecificScreen),
Navigate(Auth_404)
)
when your load your app, the above formula would be executed to check if the current sign in user is a authorized user.
Best regards,