Search Component - filter by a field value on model

Michael, thanks very much for looping the other conversation in.

For easy access, here’s the link Michael shared: https://community.skuid.com/t/search-component-filter. In that conversation, Zach posts a way to tweak the Search Component’s XML to add a condition the same way you might see in a model. The caveat is that making changes via XML can sometimes yield unpredictable results, but I was able to build off of Zach’s information and get this working in my environment. What I did was I first set up two models, such that one model had a condition that was looking at a field in the other. In this case, I have an account detail model, as well as a list of other accounts whose industry match that first account. After I set up these models and conditions correctly, I transplanted the condition XML from the secondary ‘list’ model into the Search conditions, like Zach described. It’s working for me - does this work for you as well?

<skuidpage unsavedchangeswarning="yes" personalizationmode="server" showsidebar="true" useviewportmeta="true" showheader="true">
    <models>
        <model id="AccountDetail" limit="1" query="true" createrowifnonefound="false" datasource="salesforce" sobject="Account">
            <fields>
                <field id="RecordTypeId"/>
                <field id="Name"/>
                <field id="Industry"/>
            </fields>
            <conditions>
                <condition type="param" value="id" operator="=" enclosevalueinquotes="true" field="Id"/>
            </conditions>
            <actions/>
        </model>
        <model limit="100" query="true" createrowifnonefound="false" datasource="salesforce" sobject="Account" id="AccountsWithSameIndustry">
            <fields>
                <field id="RecordTypeId"/>
                <field id="Industry"/>
                <field id="Name"/>
            </fields>
            <conditions>
                <condition type="modelmerge" value="" field="Industry" operator="=" mergefield="Industry" novaluebehavior="deactivate" model="AccountDetail" enclosevalueinquotes="true"/>
            </conditions>
            <actions/>
        </model>
    </models>
    <components>
        <wrapper uniqueid="sk-13NO-260">
            <components>
                <search uniqueid="sk-13Mg-1220" soslfields="Name Fields">
                    <objects>
                        <object datasource="salesforce" id="Account" displaytemplate="{{Name}} - {{Industry}}" fields="Industry" orderby="Name DESC">
                            <fields>
                                <field id="Name"/>
                                <field id="Industry"/>
                            </fields>
                            <conditions>
                                <condition type="modelmerge" value="" field="Industry" operator="=" mergefield="Industry" novaluebehavior="deactivate" model="AccountDetail" enclosevalueinquotes="true"/>
                            </conditions>
                        </object>
                    </objects>
                </search>
            </components>
            <styles>
                <styleitem type="background"/>
                <styleitem type="border" padding="all">
                    <styles>
                        <styleitem property="padding" value="88px"/>
                        <styleitem property="box-sizing" value="border-box"/>
                    </styles>
                </styleitem>
                <styleitem type="size"/>
            </styles>
        </wrapper>
        <grid uniqueid="sk-13Lu-878" rowgutter="16px" columngutter="16px">
            <divisions>
                <division behavior="flex" minwidth="100px" ratio="1">
                    <components>
                        <pagetitle model="AccountDetail" uniqueid="sk-13M0-971">
                            <maintitle>
                                <template>{{Name}}</template>
                            </maintitle>
                            <subtitle>
                                <template>{{Model.label}}</template>
                            </subtitle>
                            <actions/>
                        </pagetitle>
                        <basicfieldeditor showheader="true" showsavecancel="true" showerrorsinline="true" model="AccountDetail" uniqueid="sk-13Ls-844" mode="read">
                            <columns>
                                <column width="100%" uniqueid="sk-13Ls-840">
                                    <sections>
                                        <section title="Section A" uniqueid="sk-13Ls-841">
                                            <fields>
                                                <field uniqueid="sk-13Ls-845" id="RecordTypeId"/>
                                                <field uniqueid="sk-13Ls-846" id="Name"/>
                                                <field uniqueid="sk-13Ls-847" id="Industry"/>
                                            </fields>
                                        </section>
                                    </sections>
                                </column>
                            </columns>
                        </basicfieldeditor>
                    </components>
                </division>
                <division behavior="flex" verticalalign="top" minwidth="100px" ratio="1">
                    <components>
                        <skootable showconditions="true" showsavecancel="true" showerrorsinline="true" searchmethod="server" searchbox="true" showexportbuttons="false" hideheader="false" hidefooter="false" pagesize="10" alwaysresetpagination="false" createrecords="true" model="AccountsWithSameIndustry" buttonposition="" mode="read" allowcolumnreordering="true" responsive="true" uniqueid="sk-13Lo-720" heading="Accounts with matching industry">
                            <fields>
                                <field id="Name" hideable="true" uniqueid="fi-13Lz-927"/>
                                <field id="Industry" uniqueid="fi-13Lo-722"/>
                            </fields>
                            <rowactions>
                                <action type="edit"/>
                                <action type="delete"/>
                            </rowactions>
                            <massactions usefirstitemasdefault="true">
                                <action type="massupdate"/>
                                <action type="massdelete"/>
                            </massactions>
                            <views>
                                <view type="standard"/>
                            </views>
                        </skootable>
                    </components>
                </division>
            </divisions>
            <styles>
                <styleitem type="background" bgtype="none"/>
            </styles>
        </grid>
    </components>
    <resources>
        <labels/>
        <javascript/>
        <css/>
        <actionsequences uniqueid="sk-13K9-293"/>
    </resources>
    <styles>
        <styleitem type="background" bgtype="none"/>
    </styles>
</skuidpage>