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 / Identify duplicate val...
Power Apps
Unanswered

Identify duplicate values of different cards in a form

(0) ShareShare
ReportReport
Posted on by 44

Hi Everyone,

I am trying to identify when two datacards with text fields within a form have duplicate values before submitting. My thought was to create a variable based on an If statement then if true show a warning and if false submit form. Question is how do I identify if the text fields in the different cards match. I tried this 

Set (_Dup, If(DataCardValue213.Text)=(DataCardValue215.Text),false))

Powerapps did not complain about the command but it does not identify a duplicate.

 

Anyone have an idea how to accomplish this??

 

Thanks

Mark

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

    @MarkFay 

    You don't need any variable for this.

    If you are just trying to show a notification banner, then your formula would be the following:

    If(DataCardValue213.Text = DataCardValue215.Text,
     Notify("Duplicate Error"),
     SubmitForm(yourForm)
    )

     

    I hope this is helpful for you.

  • MarkFay Profile Picture
    44 on at

    Thanks Randy, 

    a good option that I will play with, but right now I cant seem to get the app to identify when a duplication exists. This part doesn't seem to work.

    DataCardValue213.Text=DataCardValue215.Text

     How do I get the app to look at these fields and determine if they are the same?

     

    M

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

    @MarkFay 

    What about it is not working?

  • MarkFay Profile Picture
    44 on at

    As a test I may trying to see if a duplicate entry will set a variable. I have a text label that will display if variable is true. I have a button that on Select is Set (_Dup, If(DataCardValue213.Text)=(DataCardValue215.Text),false))

    So in my form I have two fields that I enter the same information 

     

    Untitled.jpg

    When I click on the button, it does not set the variable so I assume the condition of DataCard213 and 215 is not seen as equal for some reason. Could it be because it is a text field?

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

    @MarkFay 

     Your formula is not correct.  Please use the formula that I provided for you.

    If(DataCardValue213.Text = DataCardValue215.Text,
     Notify("Duplicate Error"),
     SubmitForm(yourForm)
    )

     

  • MarkFay Profile Picture
    44 on at

    Ok thanks that seemed to work. Now for the $1M bonus question, as you could see in the image I uploaded, I have several fields that I want to compare for duplication. Do I have to create an OR for each possible combination or is there an easy way to comapre all?

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

    @MarkFay 

    No problem...you can incorporate them all in as you need.

    If(DataCardValue213.Text = DataCardValue215.Text ||
     DataCardValue213.Text = DataCardValueX.Text ||
     ..etc..,
     Notify("Duplicate Error"),
     SubmitForm(yourForm)
    )
  • MarkFay Profile Picture
    44 on at

    Sorry one more question. After playing with this I am getting a false positive when the fields are blank. I tried to 

    If( !IsBlank (DataCardValue213) &&

        !IsBlank(DataCardValue215) &&

        !IsBlank(DataCardValue214) &&

        DataCardValue213.Text=DataCardValue215.Text ||

        DataCardValue213.Text=DataCardValue214.Text, Notify(Error),Submit(Form))

    But that doesnt work it still sees a duplicate if Datacard 214 is the only card with text.

    Is my !IsBlank logic wrong?

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 717 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 329 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard