cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
SwapnaNethi
Helper II
Helper II

Set Powerapps screen based on a filter condition

Is it possible to display the default screen of powerapps based on logged-in user's email address?

 

I have condition like below.  If there is at least 1  record on the Sharepoint list's "EmployeeEmail" column value equal to logged-in user's email address, I want to display a different screen and if not, a different screen.  

 

Where and how can I handle that? 

 

CountRows(Filter('Equipment Return Tracker' ,EmployeeEmail=User().Email))

1 ACCEPTED SOLUTION

Accepted Solutions
zmorek
Super User
Super User

You can do it OnStart of the app:

 

If(CountRows(Filter('Equipment Return Tracker' ,EmployeeEmail=User().Email))>0, Navigate(Screen),false)

 

I typed that freehand, so please watch for parenthesis, punctuation, etc.

View solution in original post

4 REPLIES 4
zmansuri
Super User
Super User

App.OnStart:

Set(varUser,User());

Set(IsUser,LookUp('Equipment Return Tracker' ,EmployeeEmail=varUser.Email));

If(IsBlank(IsUser),Navigate(Screen1),Navigate(Screen2));

 

The above code will store your logged in user's info into varUser. 

Then go to your list and compare that against the whole list. If it find any record it will store it in the variable named IsUser. Then it will check if IsUser is blank or not. If it is blank it will navigate accordingly

TheRobRush
Super User
Super User

In onstart of app you would throw out a if (countrows (where user email is on the list ) >=1), navigate to screen 1, navigate to screen 2)

_____________________________________________________________________________________
Like my answer? - Hit that Thumbs Up. Resolved the Issue? - Hit Accept as Solution.
This helps others find solutions to future issues!
zmorek
Super User
Super User

You can do it OnStart of the app:

 

If(CountRows(Filter('Equipment Return Tracker' ,EmployeeEmail=User().Email))>0, Navigate(Screen),false)

 

I typed that freehand, so please watch for parenthesis, punctuation, etc.

View solution in original post

MarvinBangert
Solution Sage
Solution Sage

Hey @SwapnaNethi 

you can use the "App" - "On Start" property/functionality to check on app start if the condition "countrows()" is equals 0 or not, if yes, navigate to screen 1, if no, navigate to screen 2.

 

Best regards
Marvin

If you like this post, give a Thumbs up. If it solved your request, Mark it as a Solution to enable other users to find it.

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Top Solution Authors
Top Kudoed Authors
Users online (1,123)