cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Ethan_R
Solution Sage
Solution Sage

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

Top Solution Authors
Top Kudoed Authors
Users online (4,207)