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 / PowerApps restrict dup...
Power Apps
Answered

PowerApps restrict duplicate data entry based on data field value

(0) ShareShare
ReportReport
Posted on by 118

Hi There,

I'm looking for a short form of coding which will check duplicate data in difference fields and restrict data duplication before submitting for save.

Such as in following image, in each FO and Team field there cannot be two Category="Approver" which will restrict the duplication and notify a message before saving the data. My Approvers data table if following ..

Form1.JPGSuch as: If I try to add a record, Name: Any Name, Category: Approver, Team: Finance, FO: CXB, it will restrict the data entry if it finds the name with same Category, Same Team and same FO.

Form2.JPG

 

That mean in each FO and each Team there will be one Approver but there can be same Name as Approver in Difference Team in different FO. such as

Form3.JPG

 

Now I have applied a formula but it seems it will be too much coding for this simple requirement.

*If(
 !IsBlank(LookUp('ExitCL02-Approvers', DorpdownCategory.Selected.Value = "Approver" && Category.Value = "Approver" && Team.Value="ICT" && FO.Value="CXB" )),
 Notify("There is already an Approver exist in " & DataCardValue12.Selected.Value & " Field Office")),
 SubmitForm(Form1);ResetForm(Form1)
);
And so on and so on....

Not sure how to achieve that. Appreciate your help on this

Regards

Leo

Categories:
I have the same question (0)
  • Verified answer
    WarrenBelz Profile Picture
    156,434 Most Valuable Professional on at

    Hi @leonardbd ,

    It is better to make the drop-down trigger first as below, but (to answer your other question) all the code is necessary to achieve the result you need

    If(
     DorpdownCategory.Selected.Value = "Approver" && 
     !IsBlank(
     LookUp(
     'ExitCL02-Approvers', 
     Category.Value = "Approver" && Team.Value="ICT" && FO.Value="CXB" 
     )
     ),
     Notify(
     "There is already an Approver exist in " & DataCardValue12.Selected.Value & " Field Office"
     ),
     SubmitForm(Form1);
     ResetForm(Form1)
    );

    Assuming also that you have the current Team and FO in a control or Variable somewhere, you would not need to hard-code this as you have.

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

    Visit my blog Practical Power Apps

  • leonardbd Profile Picture
    118 on at

    Hi Warren,

    This works just fine. Now Im trying to figure out defining the variable to avoid hard coding.

    Thanks buddy

    Regards

    Leo

  • leonardbd Profile Picture
    118 on at

    I just figured it out. Here it goes like this. I have defined two local variables in both of the dropdown's (Team and FO) OnSelect event such as

    UpdateContext({LocVarTeam:DataCardTeam.Selected.Value})

     and

    UpdateContext({LocVarFO:DataCardFO.Selected.Value})

    Then I have applied the variable in your given code and saved from lots of hard coding

    If(
     DataCardCategory.Selected.Value = "Approver" && 
     !IsBlank(
     LookUp(
     'ExitCL02-Approvers', 
     Category.Value = "Approver" && Team.Value=LocVarTeam && FO.Value=LocVarFO
     )
     ),
     Notify(
     "There is already an Approver exist in " & DataCardLocation.Selected.Value & " Location"
     ),
     SubmitForm(FormListUpdate);
     ResetForm(FormListUpdate)
    )

     Thanks a lot for your guidance 🙂

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
WarrenBelz Profile Picture

WarrenBelz 329 Most Valuable Professional

#2
11manish Profile Picture

11manish 209 Super User 2026 Season 2

#3
Mohsin Ali Profile Picture

Mohsin Ali 179

Last 30 days Overall leaderboard