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 of create dupl...
Power Apps
Answered

prevent of create duplicate item in powerapps

(0) ShareShare
ReportReport
Posted on by 23

Hello,

I would like to avoid duplicate entries when submitting the form, but only when form is in new mode (edit and submit of existing item with same button is fine). Where should I write the FormMode.New statement?

 

button OnSelect:

If(IsBlank(LookUp('CAD worklist'; Title=DataCardValue1.Text));
SubmitForm(edit_form);
Notify("Change Nr. already exists";NotificationType.Error);;
SetFocus(DataCardValue1)
)

 

Thank you very much

 

Categories:
  • BCLS776 Profile Picture
    8,994 Moderator on at

    Try adding a second condition to your If() statement:

    If(IsBlank(LookUp('CAD worklist'; Title=DataCardValue1.Text)) && edit_form.Mode = Formmode.New;
     SubmitForm(edit_form);
     Notify("Change Nr. already exists";NotificationType.Error);;
     SetFocus(DataCardValue1)
    )

    Hope that helps,

    Bryan

  • lha1bj Profile Picture
    23 on at

    Hello, I tried to add the statement,  but it is still blocking me to update current items.

    Any idea how to correct the code please?

    Thank you

  • Verified answer
    BCLS776 Profile Picture
    8,994 Moderator on at

    You can configure additional options on the If() statement to handle these situations:

     

    If(
     (IsBlank(LookUp('CAD worklist'; Title=DataCardValue1.Text)) && edit_form.Mode = Formmode.New) 
     ||
     edit_form.Mode = Formmode.Edit;
     SubmitForm(edit_form);
     Notify("Change Nr. already exists";NotificationType.Error);;
     SetFocus(DataCardValue1)
    )

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 409 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 328

#3
WarrenBelz Profile Picture

WarrenBelz 252 Most Valuable Professional

Last 30 days Overall leaderboard