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
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

365 EduCon 768x460.png

Microsoft 365 EduCon

Join us for two optional days of workshops and a 3-day conference, you can choose from over 130 sessions in multiple tracks and 25 workshops.

Users online (2,651)