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

Prevent duplicate list entries

(0) ShareShare
ReportReport
Posted on by 995

I am pulling Program Name and Project Number from list A, then populating list B with those values, once the user finishes filling in the other fields for list B, and submit, I only want 1 entry in list B for the Project Name/Number. Not sure how to do this, any help would be greatly appreciated?  Ideally it would be great if once the user select the Program Name from List A, is is no longer available to choose to create the item in list B.

 

Thanks

Kim

Categories:
I have the same question (0)
  • v-bofeng-msft Profile Picture
    Microsoft Employee on at

    Hi @kmw1130 :

    Colud you tell me:

    • What is List B?Is it a SharePoint List?
    • Do you want to "Project Name/Number" to be a cloumn that enforce unique values?

    If so,please turn on the 'Enforce unique values' feature in columns setting:

    1.JPG

    Best Regards,

    Bof

     

  • kmw1130 Profile Picture
    995 on at

    @v-bofeng-msft Yes, both are SharePoint List. I was wondering if it would be that easy as to set it at the SharePoint Level.  I thought I had read on another thread that it had errors.  

  • kmw1130 Profile Picture
    995 on at

    So I changed the Project Number field to enforce unique values.  It works, but gives an ugly message.  Is there a way to change that message into something that looks better?

  • v-bofeng-msft Profile Picture
    Microsoft Employee on at

    Hi @kmw1130 :

    If you want to try other methods, could you please provide more details of your app?(formulas, contorls... preferably with screenshots)

    Another way is to directly filter the items where the value of'Project Name/Number' in ListA does not exist in ListB. So there is no need to worry about duplicate'Project Name/Number' when importing records in ListA into ListB.Something like:

    Filter(listA,!('Project Name/Number' in ListB.'Project Name/Number')

    Best Regards,

    Bof

     

  • kmw1130 Profile Picture
    995 on at

    List A Gallery: If(

    ddBUs.Selected.Result = "All",
    Filter(ListA,'Active Project'.Value = "Active (Y)"),
    //This is for BU Dropdown
    ddBUs.Selected.Result <> "All",
    Filter(ListA,'_Business Unit' = ddBUs.Selected.Result, 'Active Project'.Value = "Active (Y)"))

     

    List B Form:  4 fields from List A are populated when select item in List A is selected.

    kmw1130_0-1611229360130.png

     

  • v-bofeng-msft Profile Picture
    Microsoft Employee on at

    Hi @kmw1130 :

    If List B Form's DefaultMode property is "New".You could try this solution:

    Set the Submit button's OnSelect property to:

     

    If(
     IsBlank(LookUp(ListB,ProjectNoTextInput.Text='Project Name/Number')),/*Check if there are duplicate Project Name/Number in ListB*/
     SubmitForm('List B Form'),
     Notify("Duplicate Project Name/Number")
    )

    If List B Form's DefaultMode property is "Edit".You could try this solution:

    Set the Submit button's OnSelect property to:

    If(
     IsBlank(LookUp(ListB,ProjectNoTextInput.Text='Project Name/Number'&& ThisItem.ID <> ID)),/*Check if there are duplicate Project Name/Number in ListB*/
     SubmitForm('List B Form'),
     Notify("Duplicate Project Name/Number")
    )

     

    Best Regards,

    Bof

  • kmw1130 Profile Picture
    995 on at

    @v-bofeng-msft 
    Default Mode is Edit

    I'm getting an error

    If(
    IsBlank(LookUp('Program Tracking',DataCardValue32.Text = ProgramID && ThisItem.ID <> ID)),
    SubmitForm(FormIssues),
    Notify("Duplicate Program Name/Number")
    )

    kmw1130_0-1611329106518.png

     

  • kmw1130 Profile Picture
    995 on at

    I've updated my function on the submit button:

     

    If(
    IsBlank(LookUp('Program Tracking',DataCardValue32.Text = ProgramID && ThisRecord.ID <> ID)),
    SubmitForm(FormIssues),
    Notify("Duplicate Program Name/Number")
    )

     

    But a duplicate was still created in my sp list.

  • Verified answer
    v-bofeng-msft Profile Picture
    Microsoft Employee on at

    Hi @kmw1130 :

    Please use the item property in "FormIssues" to replace "ThisRecord". The purpose of this judgment condition is to ensure that there is no record with the same ProgramID in the data source except for this record.

    Best Regards,

    Bof

  • kmw1130 Profile Picture
    995 on at

    Yes that worked.  Thank you!

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 June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 326 Most Valuable Professional

#2
11manish Profile Picture

11manish 168

#3
sannavajjala87 Profile Picture

sannavajjala87 75 Super User 2026 Season 1

Last 30 days Overall leaderboard