cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
sayalides
Helper III
Helper III

Two Popups on a single button click

Hey Team,

 

I have created a form in power apps with AX as the back end. On the submit button I'm checking with my back end for duplicate entry if the entry is already present in my db then a popup for DuplicateENtry should be visible and if the record doesn't exists in the db it should submit the form and a SubmitPopUp should appear.The problem is every time I click the submit button even if the record already exists in the db it does not submit the form but I get only the submitPopUp and not the DuplicatePopUp. 

My logic on submit button is:

If(EmailAddress.Text in EmployeePAs_1.Email,UpdateContext({DuplicatePopUp:true});ResetForm(Form2),SubmitForm(Form2);UpdateContext({SubmitPopup:true})) and I have the set the visibility for DuplicatePOpup group as "DuplicatePopUp" and for submitpopgroup as "SubmitPopup"

Please help me as what is wrong and why I get my duplicate entry popup when the record already exists.

 

9 REPLIES 9
anabananei
Resolver I
Resolver I

Hi @sayalides ,

 

I did a test on my side and I'm not able to replicate your problem.

 

Can you try interchanging your formula of submit to 

If(EmailAddress.Text in EmployeePAs_1.Email,UpdateContext({DuplicatePopUp:true});ResetForm(Form2),UpdateContext({SubmitPopup:true});SubmitForm(Form2))

If this still not works, then can you check the order of you popup in the tree view? Make sure the popup objects are at the top of your app.

 

Let me know if this works.


Thanks! 

Hi @anabananei ,

 

I tried the suggestion you gave me but the situation is the same.I'm still getting "SubmitPopUp" for duplicate entry and also my popups are at top of my app.

Hi @sayalides ,


Can you share a screenshot of your app? Or how it works?

 

Do you have a variable that will disable the popup? Like a cancel button with

UpdateContext({DuplicatePopUp:false})

or

UpdateContext({SubmitPopup:false})

 

Can you also double check the visible property of the Popup? Are they grouped with each other?

Hi @anabananei ,

Powerapps issue (2).png

 

This is my app and yes there is a cancel button for "DuplicatePopup" with UpdateContext({DuplicatePopup:false}),and a thankyou button on submit popup with UpdateCOntext({SubmitPopUP:false}).

Hi @anabananei ,

The boolean value of my variable "DuplicatePopup" is not changing only. In the variables section it is showing the value of '"DuplicatePopup" as "no value" and even after clicking the submit button with duplicate entry the boolean value of "DuplicatePopup" is not changing.Why is that happening?

Your formula should work. Did you duplicate your original popup? Maybe you can check each of the object's Visible property.

 

Can you Ungroup your popup objects first? Then check for the Visible property of each objects and set it to true.


Example:

Rectangle

Label

Button

 

Then group it again and set the Visible property of the group to your variable.

 

Can you check in the variables tab what objects uses the DuplicatePopUp variable? Also, try renaming the variable to DupPopUp.

Hi @anabananei ,

 

I did all of it whatever your suggested but it still doesn't work.😭

Ok, we can try to troubleshoot this one.

 

  1. First, create a new screen.
  2. Add an Editform, link it to your data source. 
  3. Add a data card inside the form. For this case, insert the email data card
  4. Get the DataCardValue of the email field to reference it to your button
  5. Create a button for Submit, add your conditions and variables, give it a different name

 

 

If(DataCardValue.Text in EmployeePAs_1.Email,UpdateContext({popupduplicate:true});ResetForm(EditForm),SubmitForm(EditForm);UpdateContext({popupsuccess:true}))​

 

 

  • Create another button for New Form and set the OnSelect to (this is just for troubleshooting)

 

 

NewForm(EditForm);UpdateContext({popupduplicate:false});UpdateContext({popupsuccess:false})​

 

 

  • Add Label 1, input Text to "Duplicate. Set Visibile property to popupduplicate
  • Add Label 2, input Text to "Success". Set visible property to popupsucess
  • Test if it should function the way you wanted it to. Every time you hit the Submit button, make sure to hit the New Form button, in this way, it resets the variable.

If this works, then there is something wrong within your solution and try to investigate. You can rebuild it though if you prefer.

 

Thanks.

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

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

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 (4,269)