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

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Do not allow duplicate...
Power Apps
Unanswered

Do not allow duplicates, however allow current records to be updated

(0) ShareShare
ReportReport
Posted on by

I have a ticketing system where the SharePoint list has a column for Ticket #. I want to prevent people from entering a duplicate ticket #, but still allow them to change an existing record.

Is there a way to check if the record exists and if there are other columns changed, then allow them to submit with the updated info vs stopping them from entering a new record with the same ticket #? I am guessing it has to do with if the form is "new" vs editing. 

Also, it would be nice to display the error message that they are entering a duplicate record on a "new" form right after they entered the ticket # vs entering all the details and hitting submit -- then showing the duplicate message.


Categories:
I have the same question (0)
  • RandyHayes Profile Picture
    76,297 Super User 2024 Season 1 on at
    Re: Do not allow duplicates, however allow current records to be updated

    @AnnetteM 

    First for the warning label (in your form)...create one with your duplicate warning message. 

    Then, set the Visible property to:

    LookUp(yourData, TicketNumber = Value(yourTicketInput.Text), true) && IsBlank(ThisItem.ID)

    Assuming your TicketNumber is numeric.

    Set the DelayedOutput of your textinput to true to avoid this formula running on each keystroke.

     

    Ideally, you would then change your DisplayMode property of your submit button to:

    If(!yourForm.Valid || !yourForm.Unsaved || yourWarningLabel.Visible, Disabled, Edit)

     

    Now...I am not dure what you mean about letting them submit anyway though...are you stating you want to let them submit a duplicate?

  • AnnetteM Profile Picture
    on at
    Re: Do not allow duplicates, however allow current records to be updated

    Here is what I am hoping for. 

    If they are entering a NEW ticket, I want it to check if there is a ticket number already entered with the same number. If there is, they are warned that it already exists and can't be used and stops them from entering a bunch more info, then submit, before the warning displays.

    If they are EDITING a previously submitted ticket to change data to another column on the form, say they add a comment to the ticket, I want the "is it a duplicate" check to by bypassed because they are editing a record and not adding a new/duplicate one.

  • Verified answer
    RandyHayes Profile Picture
    76,297 Super User 2024 Season 1 on at
    Re: Do not allow duplicates, however allow current records to be updated

    @AnnetteM 

    Very good...then the formulas I provided will do exactly that!

     

    I would also add to your scenario that you do not allow someone to change the ticket number when the record is being edited.  Otherwise, as you stated, the ticket number check will not apply and you could end up with a duplicate if they enter an existing number to edit a previous one.

    For that, I would add the following formula to the DisplayMode property of the TicketNumber datacard:

    If(IsBlank(ThisItem.ID), Edit, View)

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

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 322 Super User 2025 Season 2

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 209 Super User 2025 Season 2

Last 30 days Overall leaderboard