I'm trying to work out the new StartScreen property in App.
Previously my formula on App.OnStart was:
Set(loggedUserEmail,Office365Users.MyProfileV2().mail);
Set(varDPA, If(LookUp(Permissions, loggedUserEmail in Person.Email, true), true, false));
If(LookUp(ProjectRegister, loggedUserEmail = Author.Email || loggedUserClaims in IAO.Email, true), Navigate('Home Screen'), Navigate('Welcome Screen'))
I removed the last line of code from OnStart and added this to StartScreen:
If(LookUp(ProjectRegister, Or(loggedUserEmail = Author.Email, loggedUserEmail = IAO.Email), true), 'Home Screen', 'Welcome Screen')
However, I get the error message that global variables aren't allowed in the StartScreen property.
I see we have to use named formulas but what I tried didn't work. I guess I could replace loggedUserEmail with Office365Users.MyProfileV2().mail but then it would be querying it more than once.
My global variable loggedUserEmail is also used for looking up varDPA so it doesn't make sense not to use it again.
What is the best thing to do here?