Condition to determine if field value in one model is selected in multipick field in another model

  • 1
  • Question
  • Updated 1 year ago
  • Answered
Model A has a Multipicklist__c field.
Model B has a Picklist__c field.
Both use the same value set.

Is there a way I can write a condition on Model B to return records where the value of Picklist__c is one of the selected values in the Multipicklist__c field in the first row of Model A?

I would have expected 'in' to work, but apparently 'in' acts like '=' over multiple rows?
Photo of Matt Sones

Matt Sones, Champion

  • 31,702 Points 20k badge 2x thumb

Posted 1 year ago

  • 1
Photo of Matt Sones

Matt Sones, Champion

  • 31,702 Points 20k badge 2x thumb
Hmm. Interesting idea, Raymond. The series of conditions on boolean fields would work, as I only have 4 options in the value set.

No relationship between the objects.

This did force me to rethink the use case a bit... I was going to use two models to display information for the "in" and "not in", but I'm thinking I'll just return all the rows in Model B, and then write a skuid formula field on that model as my "condition", like so:
IF(CONTAINS({{$Model.SelectedMenu.data.0.Default_Profile_Visibility__c}},{{Profile__c}}),"fa-eye","fa-eye-slash"). 
Photo of mB Pat Vachon

mB Pat Vachon, Champion

  • 42,926 Points 20k badge 2x thumb
Working?

Assume Model A will only have the one row then?
Photo of Matt Sones

Matt Sones, Champion

  • 31,702 Points 20k badge 2x thumb
Yes, that's right. Thanks!