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

App On Start Popup Show and Hide

Hi,

I have an application which stores Email, ID and VaccineType in Sharepoint list. The First screen is a View Form, without the gallery. 
Because every user will have Only One Record in list.

So, I want to display a Popup like, if the user is new and it opens the app, the view form will be shown empty for that I want to show a popup message with a text( No record found, Create a New record ) and there is a Create button in that same screen.

and after creating record, the user should show its data and the popup should be hidden till for the new user and whenever that user's record is deleted from the list, it should show the popup as it will be creating a new record. 

I have created a popup but it's still displaying even after creating a record.

Popup Components grouped and there Visible property is  ( InfoPopup )

App On Start Code  I am checking the current logged in user email with the stored email if it found then it should not display the popup either way display the popup

Set(RecordExist, If( IsBlank( LookUp(VaccineDemo, Lower(Email) = Lower(User().Email))), "No", "Yes" ));

If(RecordExist="No", Set(InfoPopup ,true));

If(RecordExist="Yes", Set(InfoPopup ,false));


Any Help? 
@RandyHayes 

1 ACCEPTED SOLUTION

Accepted Solutions
RandyHayes
Super User III
Super User III

@MH3 

Yes, as @RusselThomas mentioned, if Delegation is a concern that you have over 2000 records, then consider the formula to be:

Set(glbUser, User());

Set(InfoPopup, !LookUp(VaccineDemo, StartsWith(Email, glbUser.Email), true))
_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

View solution in original post

5 REPLIES 5
RandyHayes
Super User III
Super User III

@MH3 

Please consider changing your OnStart Formula to the following:

Set(glbUser, User());

Set(InfoPopup, !LookUp(VaccineDemo, Lower(Email) = Lower(glbUser.Email), true))

 

Make sure you have the "Use non-blocking OnStart rule" turned off in your app settings.

 

Also, not related to any issue but for clarification, when you Group controls, it simply groups them together.  The "Group" itself has NO properties.  When you select a group and then go to the properties, such as Visible, you are really altering the Visible property of ALL the controls in the group, because again, the group has not properties.

I mention this because I see people wipe out their formulas on properties very quickly by doing this method and not realizing that it is not a group property.  So, if you have a control in your group and you have set its Visible property to some formula, and then you select the group to change what you think is the "group's" visible property, you will wipe out the one in the control.

Just thought I would mention that for clarity based on how you mentioned it.

 

I hope this is helpful for you.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes
RusselThomas
Microsoft
Microsoft

Hi @MH3 ,

Couple of things that might be going on here.

First, you could probably simplify your logic to this;

Set(InfoPopup, IsBlank( LookUp(VaccineDemo, Lower(Email) = Lower(User().Email)))

But you're also probably getting some delegation issues with that formula, which might return a false positive because it's only checking the first n rows of data, where 'n' is your data row limit (usually 500). 

If you use something like StartsWith() then at least you can dispense with the Lower() function as StartsWith() is both delegable and case insensitive.

Set(InfoPopup, IsBlank(LookUp(VaccineDemo, StartsWith(Email, User().Email))))

I usually prefer to variabilise User().Email as well, but it looks like PowerApps has started doing this automatically for filter and lookup queries lately, so it might not be necessary.  If you are seeing a blue line under it with a delegation warning, then perhaps add this instead;

Set(gvarUserEmail, User().Email);
Set(InfoPopup, IsBlank(LookUp(VaccineDemo, StartsWith(Email, gvarUserEmail))))

The logic here results to 'true' when the result is blank - so if you use InfoPopup as your visible: property variable on your dialogue box and related controls, then they should pop up when the lookup returns blank.  Just remember to set it to false when they submit their info.  

The last thing to consider is timing when using something like App Start - i.e. what is the value of the variable on App Startup, while the query is running for the first time? Is the timing of the app startup and first screen load affecting your outcome?   If so, then you may want to fiddle with the "Use non-blocking OnStart" rule in your app advanced settings. 

Hope this helps,

Kind regards,

RT

RandyHayes
Super User III
Super User III

@MH3 

Yes, as @RusselThomas mentioned, if Delegation is a concern that you have over 2000 records, then consider the formula to be:

Set(glbUser, User());

Set(InfoPopup, !LookUp(VaccineDemo, StartsWith(Email, glbUser.Email), true))
_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

View solution in original post

Hi @RandyHayes  @RusselThomas 

Thanks for the replies.


I was literally stuck on showing this popup and then I got to know about this 

 "Use non-blocking OnStart" rule in app advanced settings. 


I have a question the app only have 1 record per user, so I am using this code on my View Form Items property

LookUp(VaccineDemo,Lower(Email)=Lower(User().Email))


it shows a blue line under this formula, will this formula work over 2000 records? 

RandyHayes
Super User III
Super User III

@MH3 

No, that formula is not delegable.

If you are using the selected formula changes made, then change your formula to the following for the Item property:

LookUp(VaccineDemo, StartsWith(Email, glbUser.Email)
_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Helpful resources

Announcements
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

secondImage

Demo Extravaganza Winner Announcement

Please join us on Wednesday, July 21st at 8a PDT. We will be announcing the Winners of the Demo Extravaganza!

V3_PVA CAmpaign Carousel.png

Community Challenge - Giveaways!

Participate in the Power Virtual Agents Community Challenge

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.

Top Solution Authors
Top Kudoed Authors
Users online (2,742)