cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
McMonty
Resolver I
Resolver I

CDS optionset

Hi, I'm trying to set the fill property based on an items optionset value, and can't get it to work.

Is there a secret to doing this? I thought this would be straightforward, but it's proving to be nothing but that.

 

If(ThisItem.'Contact Match' = 'Contact Match (Mailing List Contacts)'.Yes,Color.Red,Color.Blue)

 

Any ideas?

2 REPLIES 2
Drrickryp
Super User
Super User

Hi @McMonty 

I have no idea if the equation in your formula is correct, but if it is,  try

 

 

If(
    !IsBlank(
             ThisItem.'Contact Match' = 'Contact Match (Mailing List Contacts)'
     ),
      Red,
      Blue
)

 

If you want to test for a contact that is in your mailing list, you may have to use 

 

If(
    !IsBlank(Lookup(ContactList, ContactName=ThisItem.ContactName),Red, Blue
)

 

As the equation to test where the you are looking to establish membership of a ContactName in a table of contacts. You would replace ContactList and ContactName with the actual table and field names.

 

 

Hi, managed to fix it. The syntax was correct, but the app only accepted it after I saved, closed and reopened again. Haven't seen that before.

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Top Solution Authors
Top Kudoed Authors
Users online (2,502)