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 / Condition to Set Butto...
Power Apps
Unanswered

Condition to Set Button to Disabled

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Not sure why this isn't working.

 

If the content of Gallery 'Unique ID' field equals any entry in UnqID field of MemberList set button to DisplayMode.Disabled else Edit. 

 

If(NewMemberGalleryUniqueIDFld.Text = MemberCollection.UnqID,true, Disabled,Edit)

 

3csman_0-1612920707781.png

 

Categories:
  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    @Anonymous 

    Use this

     

    If(
     NewMemberGalleryUniqueIDFld.Text = MemberCollection.UnqID,
     DisplayMode.Edit,
     DisplayMode.Disabled
    )
  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Doesn't like that either.

     

    3csman_0-1612922374357.png

     

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    I suspect you are trying to compare different data types, hence the redlined '=' operator.

     

    If MemberCollection.UnqID data type is a number then try wrapping your NewMemberGalleryUniqueIDFld in the Value() function, ie

     

    Value(NewMemberGalleryUniqueIDFld.Text)
  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Same result.

    3csman_0-1612922896017.png

     

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    What is the error? Have you tried doing some basic error checking yourself?

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    'Invalid argument type'

     

    Yes, I have I tried to edit it several times, without success.

     

    Assumed what you provided was the solution.

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Unfortunately, I cannot see your data types, it's up to you to share those.

     

    So, back to the original question,

    1. Are you adding this code onto the DisplyMode of the button?

    and

    2. Are you checking NewMemberGalleryUniqueIDFld.Text against a single value (because this is what I assumed your condition was doing based on the code you supplied) ... OR ... is it being checked against a LIST OF ITEMS to see if it existing in that list. If the latter, then there is more to do with your code than a simple comparison check.

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    I tried to type this in the reply and kept getting a bad html text error for some reason. This is a Word cut a paste.

     

    3csman_2-1612934696830.png

     

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    What type of data sources are MemberList and MemberCollection? Are they in app collections or some external source?

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

#2
M Bilal Khan Profile Picture

M Bilal Khan 323

#3
Mohsin Ali Profile Picture

Mohsin Ali 226

Last 30 days Overall leaderboard