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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Popup For Duplication
Power Apps
Answered

Popup For Duplication

(0) ShareShare
ReportReport
Posted on by 221

Hi

    I am trying to create a popup whenever there is a duplicate added to the table. The individual would put their information in the form and submit it, if there is a duplicate detected based on the criteria, I would like a popup letting them know that one has been detected. However, I am getting an error in my formulas. I need help with this please. 

 

Submit Button:

If(IsBlank(LookUp('[incentive_test].[Lkp_Teaching]', Provider=DataCardValue2_1.Text And PROVIDERNUMBER=DataCardValue2_1.Text And Month=DateValue2_1.InputTextPlaceholder And Hours=DataCardValue3_1.Text)),

SubmitForm('MS Data Entry'),

Set(DuplicationPopUp,true))

 

Ignore And Save Button:

OnSelect:

SubmitForm('MS Data Entry')

UpdateContext({DuplicationPopUp:Blank()})

Visible: LBLDup.Visible

 

Cancel Button

OnSelect:

UpdateContext({DuplicationPopUp: Blank()})

Visible:

'LBL Save Changes'.Visible

LBL Save Changes

Visible:

!IsBlank(DuplicationPopUp)

Rectangle

Visible:

LBLDup.Visible

NitroPepsi_2-1666128418171.png

 

 

 

 

 

Categories:
I have the same question (0)
  • RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @NitroPepsi 

    What is the error you are getting and in which formula?

  • NitroPepsi Profile Picture
    221 on at

    The first is on the submit button when they would submit the information. 

    First Error

    It is telling me incompatible types 

    If(IsBlank(LookUp('[incentive_test].[Lkp_Teaching]', Provider=DataCardValue2_1.Text And PROVIDERNUMBER=DataCardValue2_1.Text And Month=DateValue2_1.InputTextPlaceholder And Hours=DataCardValue3_1.Text)),
    SubmitForm('MS Data Entry'),
    Set(DuplicationPopUp,true))

    NitroPepsi_1-1666129188842.png

     

    Second error

    It does not like update Context 

     

    SubmitForm('MS Data Entry')
    UpdateContext({DuplicationPopUp:Blank()})

    NitroPepsi_0-1666129152662.png

     

     

    NitroPepsi_2-1666129222548.png

     

     

  • Ramole Profile Picture
    Super User 2024 Season 1 on at

    @NitroPepsi 
    Submit and Update Context you missing comma : and DataCardValue3_1 Value() wrap Hours = Value(DataCardValue3_1.Text) and why are using UpdateContext({DuplicationPopUp:Blank()}) and Set(DuplicationPopUp,true)

  • NitroPepsi Profile Picture
    221 on at

    I tried to write that in but it did not like it 

    If(IsBlank(LookUp('[incentive_test].[Lkp_Teaching]', Provider=DataCardValue2_1.Text And PROVIDERNUMBER=DataCardValue2_1.Text And Month=DateValue2_1.InputTextPlaceholder And DataCardValue3_1 Value()wrap HoursDataCardValue3_1.Tex))),
    SubmitForm('MS Data Entry'),
    UpdateContext({DeletePopup});

     

     

    Now for the "why are using UpdateContext({DuplicationPopUp:Blank()}) and Set(DuplicationPopUp,true)" It is because I am playing around to try to get it to work and I cant 😞

  • Ramole Profile Picture
    Super User 2024 Season 1 on at

    @NitroPepsi 
    Will have look your code later as am not near pc to check, maybe will do it different approach 

  • RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @NitroPepsi 

    The formula is not correct!

    Should be changed to:

    If(
     LookUp('[incentive_test].[Lkp_Teaching]', 
     Provider=DataCardValue2_1.Text And 
     PROVIDERNUMBER=DataCardValue2_1.Text And 
     Month=DateValue2_1.InputTextPlaceholder And 
     Hours = DataCardValue3_1.Text, 
     true
     ),
     UpdateContext({DeletePopup: true}),
     SubmitForm('MS Data Entry')
    )

     

    However, in your first Formula you were using Set.  In this one you are using UpdateContext...which is it?  One is a context variable and the other is a global variable.  You should not have two with the same name!

     

     

  • Ramole Profile Picture
    Super User 2024 Season 1 on at

    @NitroPepsi 
    The code provided by @RandyHayes  should work for you, for me normally I use filter to check duplicate to avoid delegation and also show the user the duplicate information found, example like date record created, in you case PROVIDERNUMBER, Month

     

  • NitroPepsi Profile Picture
    221 on at

    Hi, 

         I removed the date and time because it was saying that the text and the inputtextplaceholder were not compatible and I just left the Provider name and provider number in there. It did not give me any more errors once I removed those. However, my popup did not popup. I would make a duplicate with the same provider's name and provider number, and nothing would happen. I switch the And to OR and the same issue, the popup did not come up when I was trying to make a duplicate.

     

    Submit Button

    If(
    LookUp('[incentive_test].[Lkp_Teaching]',
    Provider=DataCardValue2_1.Text And
    PROVIDERNUMBER=DataCardValue2_1.Text,
    true
    ),
    UpdateContext({DeletePopup: true}),
    SubmitForm('MS Data Entry')
    )

     

    This is the popup

    Ignore And Save Button:

    OnSelect:

    SubmitForm('MS Data Entry')

    UpdateContext({DuplicationPopUp:Blank()})

    Visible: LBLDup.Visible

     

    Cancel Button:

    OnSelect:

    UpdateContext({DuplicationPopUp: Blank()})

    Visible:

    'LBL Save Changes'.Visible

     

    LBL Save Changes:

    Visible:

    !IsBlank(DuplicationPopUp)

     

    Rectangle:

    Visible:

    LBLDup.Visible

  • Verified answer
    RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @NitroPepsi 

    Keep in mind that your Lookup is very specific.  

    It is saying that the Provider and PROVIDERNUMBER must be equal to what you provided.

    This means that any deviation in letter-case or spacing will not result in a match.


    You can attempt to loosen it up a little with this:

    If(
     LookUp('[incentive_test].[Lkp_Teaching]',
     StartsWith(Provider, DataCardValue2_1.Text) &&
     StartsWith(PROVIDERNUMBER, DataCardValue2_1.Text),
     true
     ),
     UpdateContext({DeletePopup: true}),
     SubmitForm('MS Data Entry')
    )
  • NitroPepsi Profile Picture
    221 on at

    Thank you for your help @RandyHayes and @Ramole I was able to get it to work! I went back and added the Hours data card and put the value part and it work! Thank you for another week of employment! 

     

    If(
    LookUp('[incentive_test].[Lkp_Teaching]',
    Provider=DataCardValue1_1.Text &&
    PROVIDERNUMBER=DataCardValue2_1.Text &&
    Hours=Value(DataCardValue3_1.Text),
    true
    ),
    UpdateContext({DuplicationPopUp: true}),
    SubmitForm('MS Data Entry')
    )

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 379 Most Valuable Professional

#2
11manish Profile Picture

11manish 203 Super User 2026 Season 2

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 128 Super User 2026 Season 2

Last 30 days Overall leaderboard