I spend some time playing with this today. I don’t think you will be able to use the ui only multi-piclklist field to select a number of accounts and filter the second model based on that selection. The picklist field output format does not work in the where clause of the SOQL statement being executed on the second model. Its gonna be a dead end.
But there is another way. Have you tried a multi-select filter on that second model? You can use a filter set component to put that multi-select filter anywhere you want, and you can have the values available to select be sourced from the first accounts model. I think it will do everything you want.
I whipped up a quick example - that includes the deck of selected accounts and the contacts in them. You will need to be on a somewhat recent version of Skuid for this to work, (Chicago or newer). It’s code is below.
Note - I added a model action in the “Filtered Accounts” model to do two things. 1. Query for the contacts related to the selected account, and 2. Detect that NO accounts were selected and empty the model.
Hopefully this is a reasonable solution for you.
<skuid__page unsavedchangeswarning="yes" personalizationmode="server" showsidebar="true" showheader="true">
<models>
<model id="AllAccounts" limit="20" query="true" datasource="DemoOrgSFDC" sobject="Account">
<fields>
<field id="RecordTypeId"/>
<field id="RecordType.Name"/>
<field id="Name"/>
<field id="X18_character_ID__c"/>
</fields>
<conditions/>
<actions/>
</model>
<model id="FilteredAccounts" limit="20" query="false" datasource="DemoOrgSFDC" sobject="Account">
<fields>
<field id="RecordTypeId"/>
<field id="RecordType.Name"/>
<field id="Name"/>
<field id="X18_character_ID__c"/>
<field id="Id"/>
</fields>
<conditions>
<condition type="multiple" value="" field="Id" operator="in" enclosevalueinquotes="true" clientorserver="server" state="filterableoff" inactive="true" name="Id">
<values>
<value/>
</values>
</condition>
</conditions>
<actions>
<action>
<actions>
<action type="branch" whenfinished="stop" model="FilteredAccounts">
<formula>{{$Model.FilteredAccounts.conditions.0.inactive}}=true</formula>
<iftrueactions>
<action type="emptyModelData">
<models>
<model>FilteredAccounts</model>
</models>
</action>
</iftrueactions>
</action>
<action type="requeryModels" behavior="loadmore">
<models>
<model>Contacts</model>
</models>
</action>
</actions>
<events>
<event>models.loaded</event>
</events>
</action>
</actions>
</model>
<model id="Contacts" limit="" query="false" datasource="DemoOrgSFDC" sobject="Contact">
<fields>
<field id="Name"/>
<field id="Email"/>
<field id="AccountId"/>
<field id="Account.Name"/>
</fields>
<conditions>
<condition type="multiple" value="" field="AccountId" fieldtargetobjects="Account" clientorserver="server" state="filterableoff" inactive="true" name="AccountId" operator="in" enclosevalueinquotes="true">
<values>
<value/>
</values>
</condition>
</conditions>
<actions/>
</model>
</models>
<components>
<skuid__grid uniqueid="sk-wip-26218" flexDirection="row" justifyContent="flex-start" alignItems="flex-start" columnGutter="4" rowGutter="4">
<divisions>
<division minWidth="100px" ratio="0" alignSelf="auto" maxWidth="300px">
<components>
<skuid__filterSet model="FilteredAccounts" uniqueid="sk-wmT-69939" layout="vertical">
<filters>
<skuid__filter uniqueId="sk-wmV-70602" type="multiselect" conditionSource="manual" labelMode="manual" createFilterOffOption="false" filterOffOptionLabel="No Accounts" enableTypeahead="true" conditionName="Id">
<sources>
<source type="manual" effectsbehavior="justdefault"/>
<source type="model" effectsbehavior="justdefault" model="AllAccounts" labeltemplate="{{{Name}}}" valuetemplate="{{Id}}"/>
</sources>
</skuid__filter>
</filters>
<filtering enableSearch="false" instantSearch="false" instantFilters="true" searchMethod="server" tokenizeSearch="false" emptySearchBehavior="remove"/>
<sorting enable="false"/>
<styles>
<spacing top="4"/>
</styles>
<positioning justifyContent="stretch" alignItems="center"/>
</skuid__filterSet>
</components>
</division>
<division alignSelf="auto" minWidth="100px" ratio="1">
<components>
<skuid__deck columnGutter=".75em" rowGutter=".75em" model="FilteredAccounts" showSaveCancel="false" verticalAlign="top" minWidth="100%" uniqueid="sk-wjC-38248" title="Selected Accounts" setMaxWidth="auto">
<components>
<skuid__text contents="Account:&nbsp; {{Name}}" uniqueid="sk-wjG-39332" model="FilteredAccounts" styleSettingsVariant="increased"/>
<skuid__table allowColumnFreezing="dragDrop" model="Contacts" uniqueid="sk-wqw-103574" mode="read" showSaveCancel="false" title="Contacts" pageSize="10" showListHeader="true" showListFooter="false" allowSortingByColumn="false">
<fields>
<field id="Name" uniqueid="fi-wqw-104092"/>
<field id="Email" uniqueid="fi-wqw-104093"/>
</fields>
<filtering enableSearch="false"/>
<actions/>
<rowActions/>
<massActions/>
<exportProperties useTableColumns="true"/>
<sorting enable="false"/>
<conditions>
<condition type="contextrow" field="AccountId" mergefield="Id" operator="=" fieldtargetobjects="Account"/>
</conditions>
</skuid__table>
</components>
<filtering enableSearch="false"/>
<sorting enable="false"/>
</skuid__deck>
</components>
</division>
</divisions>
<styles>
<spacing top="4" bottom="4" left="4" right="4"/>
</styles>
<background/>
</skuid__grid>
</components>
<resources>
<labels/>
<javascript/>
<css/>
<actionsequences/>
</resources>
<styles>
<styleitem type="background" bgtype="none"/>
</styles>
<pageregioncontents>
<pageregioncontent uniqueid="__header">
<components>
<skuid__layoutRegion sticky="true">
<components>
<skuid__text contents="Multiselect Control - Account Picker" uniqueid="sk-wig-24757" styleSettingsVariant="large">
<styles>
<spacing top="2" bottom="2" left="4"/>
</styles>
</skuid__text>
</components>
<styles>
<spacing/>
</styles>
<background type="color" color="#c6d9f0"/>
</skuid__layoutRegion>
</components>
</pageregioncontent>
</pageregioncontents>
</skuid__page>```