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 / Disable button if Name...
Power Apps
Answered

Disable button if Name is duplicate in sharepoint list

(0) ShareShare
ReportReport
Posted on by 101

Disable a form button if Name field is duplicate from existing data source

 

Data source : Metrics

 

thank you

@WarrenBelz  @BCBuizer @Drrickryp 

Categories:
  • BCBuizer Profile Picture
    22,899 Super User 2026 Season 2 on at

    Hi @Sharinah1 ,

     

    Try setting the DisplayMode property of the button to:

    If(
     !IsBlank(LoopUp(Metrics, Name = DataCardValueName.Text)),
     DisplayMode.Disabled,
     DisplayMode.Edit
    )

     

    You'll have to change DataCardValueName to the name of control that has the name that needs to be checked on.

  • Sharinah1 Profile Picture
    101 on at

    Hello thank you. I forgot to mention.

    Button to disable if name is existing for a specific column item. 

    Example:

    I have columns : Name and Subject

    for Subject 1, there should only be one name / no name duplicates, otherwise the button will be disabled.

  • BCBuizer Profile Picture
    22,899 Super User 2026 Season 2 on at

    Hi @Sharinah1 ,

     

    If I understand correctly, the maximum number of duplicates in the Name column depends on the value in the Subject column?

     

    If yes, the below should help.

    If(
     CountRows(Filter(Metrics, Name = DataCardValueName.Text))< Value(DataCardValueSubject.Text),
     DisplayMode.Disabled,
     DisplayMode.Edit
    )

     

    Again: you need to change the names of DataCardValueName and DataCardValueSubject to match the names of your controls.

  • Sharinah1 Profile Picture
    101 on at

    No sorry for misunderstanding

    NameSubject
    TerryA
    TerryA
    TerryB

     

    Please refer to the table, the submit button will be disabled to avoid duplicate Terry for Section A. 

  • Verified answer
    BCBuizer Profile Picture
    22,899 Super User 2026 Season 2 on at

    Hi @Sharinah1 ,

     

    So it's about the combination of name and subject that needs to be unique?

     

    If(
     !IsBlank(LoopUp(Metrics, Name = DataCardValueName.Text && Subject = DataCardValueSubject.Text)),
     DisplayMode.Disabled,
     DisplayMode.Edit
    )

     

  • Sharinah1 Profile Picture
    101 on at

    Thanks so much. Apologies for the basic question. It's now working well.

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

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 243 Super User 2026 Season 2

#2
WarrenBelz Profile Picture

WarrenBelz 204 Most Valuable Professional

#3
Mohsin Ali Profile Picture

Mohsin Ali 122

Last 30 days Overall leaderboard