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 / Prevent duplicate subm...
Power Apps
Unanswered

Prevent duplicate submission

(0) ShareShare
ReportReport
Posted on by 20

I created a PowerApp that reports daily topics for the beginning and the end of the day. **I am new to the powerapp software.

I would like to prevent duplicate submissions on powerapp form.

 

Within the SharePoint list that is linked to the form, I have following columns I would like to use for unique identifiers:

- "Date" with Date type

- "XX Name" with Choice type (from 2 to 5 choices)

- "Form Type" with Choice type (2 choices)

 

I have tried to create a unique ID column on SP list to prevent duplicates but it did not work. 

Please guide me through how I can achieve this 

Categories:
  • Sickle-Cell Profile Picture
    600 Super User 2024 Season 1 on at

    Hi @torasan 

     

    The reason a unique ID doesn't work as any new submission would have a new unique ID, but you can achieve what you're looking for with an If statement. You could have that before your patch to check that no record exists with the same exact values by using something like this before your patch.

     

    If(
     Date = ThisItem.Date &&
     Choice = thisItem.Choice &&
     FormType= ThisItem.FormType,
     Patch(Patch code as normal)
    )
  • Ali_Sheraz_77 Profile Picture
    141 on at

    Hi, @torasan 
    [

    Use  this code on OnSelect property of button 

    Set(varSubmitting, true);
    SubmitForm(FormName); // Replace with your form's submit function

    And use this  code on DisplayMode 

    If(varSubmitting, DisplayMode.Disabled, DisplayMode.Edit)

    Implement a timer that starts when the button is clicked. While the timer is running, prevent the form from being submitted again.
    Add a timer control and set its duration to the time frame you want to prevent another submission (e.g., 5000 milliseconds for 5 seconds).
    On the button's OnSelect event, start the timer and disable the button.
    On the timer's OnTimerEnd event, re-enable the button for further actions. 

    ]

    Please give a thumbs up if this information is helpful.

     

    Best regards,
    Ali Sheraz

  • torasan Profile Picture
    20 on at

    Where do I put this code on? The "Submit/save" button?

  • Sickle-Cell Profile Picture
    600 Super User 2024 Season 1 on at

    Hi @torasan,

     

    Yes, that's where it would go 🙂

  • torasan Profile Picture
    20 on at

    This didn't achieve my goal.

    Here is my scenario and goal:

     

    If a form with ("date", "Form Type", "XX Name(choice)" exists already, I want to prevent submitting another form that contains the same data in those 3 categories. 

    Right now, the setting you mentioned prevents me from submitting a new form. 

  • Sickle-Cell Profile Picture
    600 Super User 2024 Season 1 on at

    Hi @torasan, I can refine my suggestion a little bit then. Try this, replacing the names for your relevant data source.

     

    If(IsEmpty(
     Filter(
     DataSourceName,
     DateColumn = DatePicker.Date,
     TypeColumn = FormTypeDropdown.Selected.Text,
     NameColumn = NameInput.Text
     )
     ),
     SubmitForm(FormName),
     Notify(
     "Sorry, either the room name is blank or it already exists. Please correct this and 
     try again.",
     NotificationType.Error,
     3000
     )
    )
  • torasan Profile Picture
    20 on at

    It gives me an error putting the code on the button. I attached the screen shot below. 

     

    torasan_0-1700146160348.png

     

  • Sickle-Cell Profile Picture
    600 Super User 2024 Season 1 on at

    Hi @torasan,

     

    Try this one, should be more what you're looking for. if you get another error, please post the screenshot again 🙂

    If(IsEmpty(
     Filter(
     DataSourceName,
     DateColumn = DatePicker.Date,
     TypeColumn = FormTypeDropdown.Selected.Text,
     NameColumn = NameInput.Text
     )
     ),
     SubmitForm(FormName),
     Notify(
     "Sorry, either the room name is blank or it already exists. Please correct this and 
     try again.",
     NotificationType.Error,
     3000
     )
    )
  • torasan Profile Picture
    20 on at

    Hi @Sickle-Cell ,

     

    I am struggling with the logical test portion of IF statement...

    The screenshot is below. 

     

    torasan_0-1700150543884.png

     

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
11manish Profile Picture

11manish 402 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 328

#3
WarrenBelz Profile Picture

WarrenBelz 296 Most Valuable Professional

Last 30 days Overall leaderboard