web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Two Popups on a single...
Power Apps
Unanswered

Two Popups on a single button click

(0) ShareShare
ReportReport
Posted on by 82

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.

 

Categories:
I have the same question (0)
  • anabananei Profile Picture
    195 on at

    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! 

  • skd Profile Picture
    82 on at

    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.

  • anabananei Profile Picture
    195 on at

    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?

  • skd Profile Picture
    82 on at

    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}).

  • skd Profile Picture
    82 on at

    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?

  • anabananei Profile Picture
    195 on at

    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.

     

  • anabananei Profile Picture
    195 on at

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

  • skd Profile Picture
    82 on at

    Hi @anabananei ,

     

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

  • anabananei Profile Picture
    195 on at

    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.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 796 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 327 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard