cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Ethan_R
Super User
Super User

Cannot compare Choice Value

Hi All,

 

Quick question,

I'm retrieving record using lookup function where I get choice field value (custom - 2 option set).

Now I want to compare this value but I cannot get its choice list or direct comparing with String.

 

For example,

 

 

//IsApproved is a field (2 option set) 

Lookup(<Source Entity>, ID = Gallery.Selected.ID, IsApproved) = "Yes"

or 

Lookup(<Source Entity>, ID = Gallery.Selected.ID, IsApproved) = [@IsApproved].Yes

 

 

Both of the above doesn't work.

 

I have no clue how to compare these values.

I also tried Text(Lookup(....)) but I'm getting Argument Error.

 

Please let me know

 

Thanks

1 ACCEPTED SOLUTION

Accepted Solutions

Hi @CNT ,

 

I found the solution, its weird but the I'm getting value with OptionSet Name than the Field Name itself.

So expression became, 

Lookup(<Source Entity>, ID = Gallery.Selected.ID && IsApproved='<OptionSetName> (<Source Entity>)'.Yes)

 

Thanks 🙂

View solution in original post

4 REPLIES 4
CNT
Super User
Super User

@Ethan_R 

Please try the following (replace <Source Entity> with the actual name),

 

Lookup(<Source Entity>, ID = Gallery.Selected.ID && IsApproved='IsApproved (<Source Entity>)'.Yes)

 

Please remember to give a 👍 and accept my solution as it will help others in the future.

 

Hi @CNT ,

 

I tried this one too, but I'm not getting this 'IsApproved (<Source Entity>)' in the list or as valid expression.

Others like 'Status (<Source Entity>)' and 'Status Reason (<Source Entity>)' is available.

 

Its kinda weird that I don't see this choice field in the suggestion list.

 

Any other solution to compare it?

Hi @CNT ,

 

I found the solution, its weird but the I'm getting value with OptionSet Name than the Field Name itself.

So expression became, 

Lookup(<Source Entity>, ID = Gallery.Selected.ID && IsApproved='<OptionSetName> (<Source Entity>)'.Yes)

 

Thanks 🙂

v-xiaochen-msft
Community Support
Community Support

Hi @Ethan_R ,

 

Glad to see you solved the problem.

You could mark your own reply to close the case.

 

Best Regards,

Wearsky

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 (3,278)