cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
pokhani
Super User
Super User

App on start is directly jumping to approval screen

hi Expert, 

code on ONstart : Set(varUser,User());
Set(varUniID, Value(Param("UniqueID")));
If(varUniID<>0,Set(varRecrd,LookUp(Forecast,ID=varUniID));Navigate(ApprovalScreen));

current stage: 

i ahve two groups

1. Super user 

2. normal user

Normal user when ever request some thing on the app the superuser gets an email with link which directly jump to approval screen(PS which is working fine)

 

Issue:  when Super User (Admin) try to access the app like normal user he is directly routed to the approval screen instead of welcome screen.

 

how can i fix that. 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
BCBuizer
Super User
Super User

Hi @pokhani ,

 

Up to you, but this will stop working at one point.

 

Try replacing the navigate command with something like this then:

 

Navigate(If(IsEmpty(Filter(AdminList, Admin.Mail = User().Email)), ApprovalScreen, WelcomeScreen))


Did you like my post? Please give it a thumbs up! Did I resolve your issue? Please click Accept as Solution to close the topic and so other members of the community can find solutions more easily.

View solution in original post

3 REPLIES 3
BCBuizer
Super User
Super User

Hi @pokhani ,

 

First you need to remove the navigate function from the OnStart property since it needs to be defined in the StartScreen property.

 

In the StartSceen property you then need to define a condition where you identify whether the user is an admin or not and then route to either the ApprovalScreen or the WelcomeScreen as in the below example:

 

If(IsEmpty(Filter(AdminList, Admin.Mail = User().Email)), ApprovalScreen, WelcomeScreen)

 



Did you like my post? Please give it a thumbs up! Did I resolve your issue? Please click Accept as Solution to close the topic and so other members of the community can find solutions more easily.
pokhani
Super User
Super User

hi thank you for ur repsonse, 

but that code is required as  user request some thing than admin gets an approval link in an email which will take him to approval screen directly. 

the only concerned is when admin try to access the app normally than he is taken to approval screen instead of of welcome screen

BCBuizer
Super User
Super User

Hi @pokhani ,

 

Up to you, but this will stop working at one point.

 

Try replacing the navigate command with something like this then:

 

Navigate(If(IsEmpty(Filter(AdminList, Admin.Mail = User().Email)), ApprovalScreen, WelcomeScreen))


Did you like my post? Please give it a thumbs up! Did I resolve your issue? Please click Accept as Solution to close the topic and so other members of the community can find solutions more easily.

Helpful resources

Announcements
October Events

Mark Your Calendars

So many events that are happening this month - don't miss out!

Ignite 2022

WHAT’S NEXT AT MICROSOFT IGNITE 2022

Explore the latest innovations, learn from product experts and partners, level up your skillset, and create connections from around the world.

Power Apps Africa Challenge 2022

Power Apps Africa Challenge

Your chance to join an engaging competition of Power Platform enthusiasts.

Users online (3,899)