How do I filter a reference field using a multi select picklist

  • 1
  • Question
  • Updated 3 years ago
  • Answered
  • (Edited)
Ok, this is probably a stupid question... How do I get a reference field to successfully filter on multiple selections from a multi select picklist.

I have a reference field to Campaign and a multi-select picklist of type values. If the user picks two different types I want the reference field to be filtered to contain Campaigns of any of those types. My filter works currently if only one value is selected, but if multiple are selected I get no results. I've tried both the "in" and "contains" comparisons and get the same result either way. Seems to me "in" should be the right option... 
It seems to me like both "in" and "contains" are behaving like "contains". my single value from Campaign.Type has to fully "Contain" all of the choices from the type multipicklist which is impossible since there can only be one type on campaign....
Photo of Jerry

Jerry

  • 1,150 Points 1k badge 2x thumb

Posted 3 years ago

  • 1
Photo of Jerry

Jerry

  • 1,150 Points 1k badge 2x thumb
It looks like this might be my answer (It's a bug that has not been fixed in 2 years). So, I'm attempting to use the multiple selections filter option. My question is how do I reference the selections made on a javascript model in that provided field?
I've created a ui only picklist on Opportunity that holds the types of campaigns available, I want those selections to be applied as a filter on the campaign reference field.
Photo of Karen Waldschmitt

Karen Waldschmitt, Official Rep

  • 8,240 Points 5k badge 2x thumb
Hi Jerry~

Just wanted to see if this tutorial helps with your situation: http://help.skuidify.com/m/models-conditions-filters/l/303405-multiselect-filters-with-automatically...

Thanks!
Karen
Photo of Jerry

Jerry

  • 1,150 Points 1k badge 2x thumb
Thanks for the reply Karen, 

I have seen that page, but I am not filtering a table. What I am attempting to filter is the actual Campaign Reference field. That article is about using a reference field as a filter. 

I have built a UI only field on Opportunity model that mirrors a picklist field on Campaign. I want to be able to only search for Campaigns where one of the selected picklist field values applies.
Photo of Rob Hatch

Rob Hatch, Official Rep

  • 44,006 Points 20k badge 2x thumb
Let me see if I understand your goal. 
1. You have a campaign reference field on the opportunity object
2. You only want selected campaigns to be available to be selected in that reference field.   These campaigns should be those that have some values in a picklst field on the campaign.  (Like campaign status = active)

If this is true - you should be able to add a reference field filter on the campaign reference field lookup field. 



But maybe I've misunderstood something... 
Photo of Jerry

Jerry

  • 1,150 Points 1k badge 2x thumb
Not at all Rob, that's exactly what I want.

My issue is that when I attempt to filter those campaigns based on the values selected on the multiselect picklist (status = active, error, etc...) both the options for 'in' and 'contains' act like 'contains'.
Meaning the field on Campaign that can actually only have one of those values needs to match both.
Photo of Rob Hatch

Rob Hatch, Official Rep

  • 44,006 Points 20k badge 2x thumb
HA!  Multipicklists.  Those rotten beasts....  Here is another strategy.  More complicated.  More flexible. 

Create a campaign model that filters down to those campaigns that include the correct picklist values.  


In the reference field,  get rid of your filter and then go to the search tab of properties.   Here Make the Option source be a Model,  and the select your new campaign model at the bottom of the property panel.

Now the model will provide the values for your campaign reference field....  
Photo of Jerry

Jerry

  • 1,150 Points 1k badge 2x thumb
Thank you Rob! 

You just made my day, this works perfectly.
Photo of Rob Hatch

Rob Hatch, Official Rep

  • 44,006 Points 20k badge 2x thumb
Glad I could help! 
Photo of Jerry

Jerry

  • 1,150 Points 1k badge 2x thumb
Thought it might be helpful to any who need this in the future to spell the solution out fully so here it goes:

I have a UI only multipicklist (CampaignTypes) on my Opportunity Model that mirrors values that exist on a picklist (Type) on Campaign.

I created a new Campaign model called Filtered Campaign with the following Condition

On my Opportunity Model I placed an action based on the CampaignTypes picklist being updated