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 Apps - Building Power Apps
Unanswered

Restrict Duplicate entries in PowerApps form

(1) ShareShare
ReportReport
Posted on by 646
Hello,
 
I'm looking for a logic to avoid / to add duplicate entries into PowerApps form
 
For Example: I have below 5 field within the form:
  • StartDate
  • EmployeeID
  • Name
  • Email
  • Department
I have used a Concatenate function to combine all of the above 5 fields into one string field. This field is called Check
 
Within my form, I already have below entry added:
 
 StartDate EmployeeID  Name  Email  Department Check
12/2/2025 E5252 Prem Prem@abc.com Accounts 12/2/2025E5252PremPrem@abc.comAccounts
 
Now when the users clicks on New button to add a new record and if the user is adding same level of information as in above screenshot / table, we should get a pop-up that this record already exists and within this pop-up window show a cancel button, so that this records cannot be saved
 
But when the StartDate is different from the above and rest of the information is same, allow the users to create a new record, without any pop-up.
 
EmployeeID, Name, Email and Department can be same most of the time for multiple entries. Only the change will be in StartDate.
 
This Logic should work on Check field column.
 
Please advise. Thanks!
 
I have the same question (0)
  • Power Platform 1919 Profile Picture
    1,769 on at
    Restrict Duplicate entries in PowerApps form
     
    You can try something like this in submit button:
    // Use the same logic you already use to build Check
    With(
        {
            varCheckValue:
                Concatenate(
                    Text(DataCardValue_StartDate.SelectedDate, "[$-en-US]dd/mm/yyyy"),
                    DataCardValue_EmployeeID.Text,
                    DataCardValue_Name.Text,
                    DataCardValue_Email.Text,
                    DataCardValue_Department.Selected.Value
                )
        },
        If(
            // 2. Check if any existing record has the same Check value
            CountRows(
                Filter(
                    MyList,
                    Check = varCheckValue
                )
            ) > 0,
            // Duplicate found. show popup and do not save
            Set(varShowDuplicatePopup, true),
            // No duplicate. proceed with save
            SubmitForm(EditForm1)
        )
    )
  • Prem4253 Profile Picture
    646 on at
    Restrict Duplicate entries in PowerApps form
     
    I tried with the logic provided by you as below, but this submits the form and creates a new record to SharePoint and PowerApps form.
     
    I also do not see any Notification.
     
    With(
        {
            varCheckValue: Concatenate(
                Text(
                    DataCardValue26.SelectedDate, "[$-en-US]mm/d/yyyy"),
                CustomerName.SelectedText.Value,
                Dropdown1.SelectedText.Value,
                Dropdown2.SelectedText.Value,
                Dropdown3.SelectedText.Value,
                Dropdown4.SelectedText.Value,
                Dropdown5.SelectedText.Value,
                Dropdown6.SelectedText.Value,
                DataCardValue29.Text
            )
        },
        If(
            // 2. Check if any existing record has the same Check value
            CountRows(
                Filter(
                    'My SP List Name',
                    Check = varCheckValue
                )
            ) > 0,
            // Duplicate found. show popup and do not save
            Set(
                varShowDuplicatePopup,
                true
            ),
            // No duplicate. proceed with save
            SubmitForm(FormInspection)
        )
    )
     
    And Default property for Check field is set as below:
     
    Text(
        DataCardValue26.SelectedDate, "[$-en-US]mm/d/yyyy") & CustomerName.SelectedText.Value & Dropdown1.SelectedText.Value & Dropdown2.SelectedText.Value & Dropdown3.SelectedText.Value & Dropdown4.SelectedText.Value & Dropdown5.SelectedText.Value & Dropdown6.SelectedText.Value & DataCardValue29.Text
     
    I'm also getting a delegation warning at CountRows, as my data is above 2K.
     
    Can you please advise further
  • Power Platform 1919 Profile Picture
    1,769 on at
    Restrict Duplicate entries in PowerApps form
    I think I got the requirement wrong,I thought check is coming from datasource itself,
     
    Sorry can you try this 
    If(
        CountRows(
            Filter(
                MyList,
                StartDate = DataCardValue_StartDate.SelectedDate &&
                EmployeeID = DataCardValue_EmployeeID.Text &&
                Name = DataCardValue_Name.Text &&
                Email = DataCardValue_Email.Text &&
                Department = DataCardValue_Department.Selected.Value
            )
        ) > 0,
        Notify(
        "A record with the same StartDate, EmployeeID, Name, Email and Department already exists.",
        NotificationType.Error
    ),
        SubmitForm(EditForm1)
    )
     
    And you are correct, that CountRows throws delegation warning as the calculation is not pushed back to datasource.
  • Power Platform 1919 Profile Picture
    1,769 on at
    Restrict Duplicate entries in PowerApps form
    HI @Prem4253,
    You can also try this :
     
    // Check if a record already exists in MyList with the same values
    If(
        IsBlank(
            Lookup(
                MyList,
                // Condition: match on all these fields
                StartDate = DataCardValue_StartDate.SelectedDate &&
                EmployeeID = DataCardValue_EmployeeID.Text &&
                Name = DataCardValue_Name.Text &&
                Email = DataCardValue_Email.Text &&
                Department = DataCardValue_Department.Selected.Value,
                
                // Return column: EmployeeID (if found)
                EmployeeID
            )
        ),
        
        // If no match is found, submit the form
        SubmitForm(EditForm1),
        
        // If a match is found, show an error notification
        Notify(
            "A record with the same StartDate, EmployeeID, Name, Email and Department already exists.",
            NotificationType.Error
        )
    )
    
     
  • Prem4253 Profile Picture
    646 on at
    Restrict Duplicate entries in PowerApps form
     
    By the time I try with the logics provided by you, could you please explain the below condition been applied for
     
    // Return column: EmployeeID (if found)
                EmployeeID
     
  • Power Platform 1919 Profile Picture
    1,769 on at
    Restrict Duplicate entries in PowerApps form

    Hi @Prem4253

    What I’m trying to achieve is a duplicate check before submitting the form.
    • I use Lookup on the datasource (MyList) with the conditions:
      StartDate, EmployeeID, Name, Email, and Department.

    • If a matching record exists, Lookup will return the value of the EmployeeID column.

    • If no record exists, Lookup returns blank.

    • So my logic is:

      • Blank EmployeeID → no record found → safe to submit.

      • Non‑blank EmployeeID → record already exists → show duplicate error.

    That’s why the formula checks IsBlank(Lookup(..., EmployeeID)).
  • Prem4253 Profile Picture
    646 on at
    Restrict Duplicate entries in PowerApps form
     
    Unfortunately none of the logics are working for me. The form still creates a new record without any notification though we have duplication.
     
    Hopefully you can advised with the below logic that I applied.
    If(
        IsBlank(LookUp('My SP List',
                'Date' = DataCardValue26.SelectedDate &&
                'Customer Name' = SupplierSI.SelectedText.Value && 
                Dropdown1 = Dropdown1.SelectedText.Value && 
                Dropdown2 = Dropdown2.SelectedText.Value && 
                Dropdown3 = Dropdown3.SelectedText.Value && 
                Dropdown4 = Dropdown4.SelectedText.Value && 
                Dropdown5 = Dropdown5.SelectedText.Value && 
                'Dropdown6' = Dropdown6.SelectedText.Value, 
                'Amount' = DataCardValue29.Text ,
                Check)),    //this is the name of of my Concatenate field
    
        
        // If no match is found, submit the form
        SubmitForm(Form1),
        
        // If a match is found, show an error notification
        Notify(
            "A record with the same StartDate, EmployeeID, Name, Email and Department already exists.",
            NotificationType.Error
        )
    )
    Thanks! so far
  • Power Platform 1919 Profile Picture
    1,769 on at
    Restrict Duplicate entries in PowerApps form
     Hi @Prem4253,
    Did you check the date format from datasource and adjusted that in power apps?
    And where is check coming from (is it power apps calculation logic or from directly SharePoint calculated column)?
    And also, what is this amount column and the formula shared is different from the initial question schema.
     
    @WarrenBelz, can you please share your opinion on this thread 
  • Prem4253 Profile Picture
    646 on at
    Restrict Duplicate entries in PowerApps form
    Yes, I did adjusted the date as per date format in my data source i.e. mm/d/yyyy
     
    I had created a Text column as Check to SharePoint list and within PowerApps I have added a calculation logic to Default property as below: (where DataCardValue29 is a Number format)
     
    Text(
    DataCardValue26.SelectedDate, "[$-en-US]mm/d/yyyy") & CustomerName.SelectedText.Value & Dropdown1.SelectedText.Value & Dropdown2.SelectedText.Value & Dropdown3.SelectedText.Value & Dropdown4.SelectedText.Value & Dropdown5.SelectedText.Value & Dropdown6.SelectedText.Value & DataCardValue29.Text
    
     
    Customer Name, Drop down 1 to Drop down 5 all are drop down values and Amount column (DataCardValue29) is Number format
     
    So usually when user creates New Record and if Check column is equal to (matches) any of the available records, give a notification as 'This record already exists". If no match with Check column allow user to submit a new record.
     
    Let me know if more inform is required.
    My sincere apologize for creating any misunderstanding
  • wolenberg_ Profile Picture
    1,013 Moderator on at
    Restrict Duplicate entries in PowerApps form
    Hello, you’re almost there! To block duplicates, just check if a record with the same info already exists before submitting. Use a LookUp() to compare fields like EmployeeID, Name, Email, Department, and StartDate. If it matches, show a pop-up and cancel the save otherwise, let it go through.
     
    How to prevent duplicate entries
    1. On form submission, use a `LookUp()` to check if a record with the same `Check` value already exists:
       If(
         !IsBlank(LookUp(YourDataSource, Check = Concatenate(StartDate, EmployeeID, Name, Email, Department))),
         Notify("This record already exists.", NotificationType.Error),
         SubmitForm(YourForm)
       )

    2. If you want to allow duplicates only when `StartDate` is different, adjust the condition:
       If(
         !IsBlank(LookUp(YourDataSource, 
           EmployeeID = EmployeeID && 
           Name = Name && 
           Email = Email && 
           Department = Department && 
           StartDate = StartDate
         )),
         Notify("This record already exists for this date.", NotificationType.Error),
         SubmitForm(YourForm)
       )
     
     

    If this helped or could help others in the community, feel free to give it a like or a kudo — it helps surface useful answers for everyone!

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

Coming soon: forum hierarchy changes

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

Chiara Carbone – Community Spotlight

We are honored to recognize Chiara Carbone as our Community Spotlight for November…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 803 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 314 Super User 2025 Season 2

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 253 Super User 2025 Season 2

Last 30 days Overall leaderboard