cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
MH3
Post Prodigy
Post Prodigy

App OnStart Check Condition for Screen Navigation

Hi,

I have a PowerApp in which I am using SharePoint as a DataSource, and I am storing Current User Email in the List Called VaccineDemo which have column name = EmpEmail.

I have a Details Screen, and Create Screen, I want to Check if the Current Logged in user don't have the Email in the List then it should navigate to the Create Screen and after creation if the user reopens the app then it should navigate to the Detail Screen.

But somehow it's not working on AppStart.
My Code on AppStart

Set(glbUser, User().Email); \\Logged in User Email

Set(CheckData,!LookUp(VaccineDemo, StartsWith(EmpEmail, glbUser), true)); \\ EmpEmail SP List Column


If(CheckData=true,Navigate(CreateNew,None) & NewForm(EditForm1),Navigate(Detail2,None));


Any Help
@RandyHayes  @eka24 

1 ACCEPTED SOLUTION

Accepted Solutions
WarrenBelz
Super User III
Super User III

Hi @MH3 ,

Try this

Set(glbUser, User().Email);
If(
   IsBlank(
      LookUp(
         VaccineDemo, 
         EmpEmail = glbUser
      ).EmpEmail
   ),
   Navigate(CreateNew,None);
   NewForm(EditForm1),
   Navigate(Detail2,None)
)

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

View solution in original post

4 REPLIES 4
Jcook
Super User III
Super User III

Hey @MH3 ,

 

Try using a redirect screen as the Home Screen and place the code in the OnVisable property.

 


Did I answer your question? Mark my post as a solution!

If you like my post please hit the Thumbs Up


Proud to be a Flownaut!


Check out my blog for Power Automate tips,
tricks, and guides
FlowAltDelete





WarrenBelz
Super User III
Super User III

Hi @MH3 ,

Try this

Set(glbUser, User().Email);
If(
   IsBlank(
      LookUp(
         VaccineDemo, 
         EmpEmail = glbUser
      ).EmpEmail
   ),
   Navigate(CreateNew,None);
   NewForm(EditForm1),
   Navigate(Detail2,None)
)

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

View solution in original post

@WarrenBelz 

The Formula worked, but can you tell me what was the problem with the if condition of mine?

Guide

Hi @MH3 ,

I have never tried !LookUp, but IsBlank(Lookup( , . . . always works as long as you refer to a field.

Helpful resources

Announcements
PA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Power Query PA Forum 768x460.png

Check it out!

Did you know that you can visit the Power Query Forum in Power BI and now Power Apps

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

PowerPlatform 768x460.png

Microsoft Learn

Check out our new Discover Your Career Path blog post series and get all the details.

Users online (1,371)