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 entr...
Power Apps
Answered

Prevent duplicate entries in Excel

(0) ShareShare
ReportReport
Posted on by

My data source is an Excel file. Although I have set some validation rules in my file (wherein cells fill with red when duplicate was detected within the column), I want my app not to allow the SubmitForm function or error notification once duplicate entry was found.

 

I know this is possible with SharePoint list through the enforce unique values. Is this possible with Excel, too?

Categories:
I have the same question (0)
  • biancadevera Profile Picture
    on at

    Please help @WarrenBelz @RandyHayes @poweractivate @StalinPonnusamy 

  • StalinPonnusamy Profile Picture
    Super User 2024 Season 1 on at

    Hi @biancadevera

     

    We need to Lookup to validate for the same data exists or not.

     

     

    If(
     IsBlank(
     LookUp(
     [@ExcelTable],
     Condition
     )
     ),
     SubmitForm(EditForm1),
     Notify("Data exist already")
    )

     

     

    Sample using my Datasource

    If(
     IsBlank(
     LookUp(
     [@ProjectsExcel],
     Phase = DataCardValue4.Text
     )
     ),
     SubmitForm(EditForm1),
     Notify("Data exist already",NotificationType.Warning)
    )


    Thanks,
    Stalin - Learn To Illuminate

  • biancadevera Profile Picture
    on at

    HI @StalinPonnusamy 

     

    Currently, I have this code:

     

    If(
     Len(txtValue.Text)=0 || Len(drpValue.Selected.Value)=0,
     Notify(
     "Please fill out all fields marked with asterisk (*)", 
     NotificationType.Error
     ),
     Patch(
     {update_here}
     );
     Navigate(SuccessScreen)
    )

     

    How can I include the Lookup validation on my code? 

  • StalinPonnusamy Profile Picture
    Super User 2024 Season 1 on at

    Hi @biancadevera 

     

    Please try this

     

    If(
     Len(txtValue.Text)=0 || Len(drpValue.Selected.Value)=0,
     Notify(
     "Please fill out all fields marked with an asterisk (*)", 
     NotificationType.Error
     ),
    If(
     IsBlank(
     LookUp(
     [@ProjectsExcel],
     Phase = DataCardValue4.Text
     )
     ),
     Patch(
     {update_here}
     );
     Navigate(SuccessScreen),
     Notify("Data exist already",NotificationType.Error)
    )
    )

     


    Thanks,
    Stalin - Learn To Illuminate

  • biancadevera Profile Picture
    on at

    Hi @StalinPonnusamy 

     

    I had this error:

    biancadevera_0-1636483001418.png

    Please check this out:

     

    biancadevera_1-1636483046193.png

     

  • StalinPonnusamy Profile Picture
    Super User 2024 Season 1 on at

    Hi @biancadevera 

     

    Can you make sure the Lookup condition is correct as per your table and column-like

     IsBlank(
     LookUp(
     [@Tablename],
     ColumnName = DataCardValue1.Text
     )
     ),

     

    Post your code, so that we can validate your entire code.

     

  • biancadevera Profile Picture
    on at

    Hi @StalinPonnusamy 

     

    Please check my code:

     

    If(
     Len(txtTicketNumber.Text)=0 || Len(drpStatus.Selected.Value)=0 || Len(drpPriority.Selected.Value)=0 || Len(txtIssueDesc.Text)=0,
     Notify(
     "Please fill out all fields marked with an asterisk (*)", 
     NotificationType.Error
     ),
    If(
     IsBlank(
     LookUp(
     [@Table1],
     Ticket Number = txtTicketNumber.Text
     )
     ),
    Patch(Table1,
    If(TicketInfo.Mode=New,Defaults(Table1),galleryDashboard.Selected),
    TicketInfo.Updates,
    DetailsInfo.Updates,
     );
     Navigate(SuccessScreen),
     Notify("Data exist already",NotificationType.Error)
    )
    )

     

    Table1 - name of table

    Ticket Number - name of column

  • Verified answer
    StalinPonnusamy Profile Picture
    Super User 2024 Season 1 on at

    Hi @biancadevera 

     

    We need to check Ticket numbers exist when adding a new record.

     

    If(
     Len(txtTicketNumber.Text)=0 || Len(drpStatus.Selected.Value)=0 || Len(drpPriority.Selected.Value)=0 || Len(txtIssueDesc.Text)=0,
     Notify(
     "Please fill out all fields marked with an asterisk (*)", 
     NotificationType.Error
     ),
    
    If(TicketInfo.Mode<>New || (TicketInfo.Mode=New && IsBlank(LookUp([@Table1],Ticket Number = txtTicketNumber.Text))),
    Patch(Table1,
    If(TicketInfo.Mode=New,Defaults(Table1),galleryDashboard.Selected),
    TicketInfo.Updates,
    DetailsInfo.Updates,
     );
     Navigate(SuccessScreen),
    Notify("Data exist already",NotificationType.Error) 
    )
    )

     

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 529 Most Valuable Professional

#2
Haque Profile Picture

Haque 230

#3
Kalathiya Profile Picture

Kalathiya 217 Super User 2026 Season 1

Last 30 days Overall leaderboard