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?
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?
Matt Sones, Champion
 31,986 Points
Posted 2 years ago
mB Pat Vachon, Champion
 43,156 Points
Hmmmm .... difference in what's being compared. Single value vs array of values.
Did you try Contains?
Did you try Contains?
Matt Sones, Champion
 31,986 Points
Just tried 'contains', but it doesn't work.
If the value in Multipicklist__c is "This;That"
And the values of Picklist__c are:
1. "This"
2. "That"
3. "The other thing"
I want to return rows 1 and 2.
If the value in Multipicklist__c is "This;That"
And the values of Picklist__c are:
1. "This"
2. "That"
3. "The other thing"
I want to return rows 1 and 2.
Skuidward Tentacles (Raymond), Champion
 17,786 Points
I have run up against this before. Multipicklists can be the devil. Consider:
Salesforce formula fields can determine if a value exists in a multi picklist. So let’s say you have 5 items in your multipicklist. You could have 5 salesforce formula fields that return true if the value you are looking for is in the picklist then build conditions on those 5 Boolean fields.
You may be able to create one field that expresses all picklist choices in a comma separated list and then use the contains feature of actions to determine if the text field contains the value you are looking for.
Salesforce formula fields can determine if a value exists in a multi picklist. So let’s say you have 5 items in your multipicklist. You could have 5 salesforce formula fields that return true if the value you are looking for is in the picklist then build conditions on those 5 Boolean fields.
You may be able to create one field that expresses all picklist choices in a comma separated list and then use the contains feature of actions to determine if the text field contains the value you are looking for.
mB Pat Vachon, Champion
 43,156 Points
Matt Sones, Champion
 31,986 Points
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:
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}}),"faeye","faeyeslash").
mB Pat Vachon, Champion
 43,156 Points
Working?
Assume Model A will only have the one row then?
Assume Model A will only have the one row then?
Mark DeSimone, Official Rep
 11,964 Points
Hi Matt, Pat and Ray. I know you all have a very strong understanding of this already, and it sounds like you may have a workable approach, but I wanted to mention that Skuid Millau has a couple new formula functions that sounded like they might come in handy for a scenario like this. I'm not sure if the field's type will come into play or not, but this might be useful either way. Here's the relevant bit from our release notes:
New formula functions allow for more precise text analysis:
New formula functions allow for more precise text analysis:
 CONTAINS_ANY determines if a string contains any of a list of provided parameters.
 CONTAINS_ALL determines if a string contains all of the provided parameters.
 CASE returns different results based on whether the parameter meets the specified criteria, meaning no more complicated chains of IF functions. This function also allows for optional default values to use if none of the provided values match.
Bill McCullough, Champion
 13,250 Points
All,
Skuid has a Case statement before Salesforce implements this in Apex!
Thanks!
Bill
Skuid has a Case statement before Salesforce implements this in Apex!
Thanks!
Bill
Related Categories

Skuid on Salesforce
 2497 Conversations
 199 Followers