Can anyone help me, table rows and populating from module and then reusing the rows

  • 1
  • Question
  • Updated 1 month ago
  • Answered
I am VERY new to skuid, Can anyone help me, i need to show a table thats data is populated from a Model and allow users to multi select the rows and then use those rows selected in a wizard
Photo of Rebecca

Rebecca

  • 120 Points 100 badge 2x thumb
  • confused

Posted 1 month ago

  • 1
Photo of Matt Davis

Matt Davis, Employee

  • 734 Points 500 badge 2x thumb
Hi Rebecca - what do you want to do with the rows in the wizard? My first instinct is that you probably want to adopt them into another model, but that depends on what you're doing with the selected rows.
Photo of Matt Davis

Matt Davis, Employee

  • 734 Points 500 badge 2x thumb
Yeah that makes sense. Josef's example below shows how to get the list down to the selected items. Do you need help beyond getting it down to the list of what is selected?
Photo of Rebecca

Rebecca

  • 120 Points 100 badge 2x thumb
I will try that out and if I do let you know . Would you know how to pass an ID into the page via Field Service Lightning Mobile App?
Photo of Matt Davis

Matt Davis, Employee

  • 734 Points 500 badge 2x thumb
I think you could try what Mark & Erik are discussing in this conversation - https://community.skuid.com/skuid/topics/using-param-id-and-lightning
Photo of Rebecca

Rebecca

  • 120 Points 100 badge 2x thumb
Do you know if i can save each row selected to individual model i am wanting to show fields for each one but on different pages, i dont want all the fields for each row on one page, does that make sense?
Photo of Matt Davis

Matt Davis, Employee

  • 734 Points 500 badge 2x thumb
Yeah, the least complex solution may be to have them step through things 1 product at a time from the get go. Instead of having them select all the products at once to start, have row actions where they select which one they want to answer questions about. When they finish answering questions bring them back to the beginning so they can select another product.

There are ways to guide them through it where they mass select then step through one by one, but it takes a bit more logic. It's something along the lines of adding a UI only field to the adopted model (one with only the 4 selected products) that gets updated. When it's updated, have a branch that checks to see if its the first row (a 2nd UI only formula field with {{index}} to see row #). If it is then run whatever actions you have for determining what questions to show using that row as context & remove the row. After they finish answering have the same action run that updates all the UI formula fields, which will get the loop going again.
Photo of Josef Lagorio

Josef Lagorio

  • 2,926 Points 2k badge 2x thumb
Here's a basic page that captures what you're after. 

<skuidpage unsavedchangeswarning="yes" personalizationmode="server" showsidebar="true" useviewportmeta="true" showheader="true">
    <models>
        <model id="Contacts" limit="20" query="true" createrowifnonefound="false" datasource="salesforce" sobject="Contact">
            <fields>
                <field id="RecordTypeId"/>
                <field id="AccountId"/>
                <field id="Account.Name"/>
                <field id="Id"/>
                <field id="Name"/>
                <field id="Email"/>
            </fields>
            <conditions/>
            <actions/>
        </model>
        <model id="Contacts_Wizard" query="false" createrowifnonefound="false" datasource="salesforce" sobject="Contact">
            <fields>
                <field id="RecordTypeId"/>
                <field id="AccountId"/>
                <field id="Account.Name"/>
                <field id="Id"/>
                <field id="Name"/>
                <field id="Email"/>
            </fields>
            <conditions/>
            <actions/>
        </model>
    </models>
    <components>
        <pagetitle model="Contacts" uniqueid="sk-Ern-398">
            <maintitle>Select Contact(s)</maintitle>
            <subtitle>
                <template>{{Model.label}}</template>
            </subtitle>
            <actions/>
        </pagetitle>
        <wizard deferstepcontentsrendering="false" buttonslocation="top" uniqueid="sk-Es1-636">
            <steps>
                <step stepid="step1" steplabel="Step 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="Contacts" buttonposition="" mode="read" allowcolumnreordering="true" responsive="true" uniqueid="sk-Erm-374">
                            <fields>
                                <field id="Name" hideable="true" uniqueid="fi-Erv-554"/>
                                <field id="Email" hideable="true" uniqueid="fi-Erw-564"/>
                                <field id="Account.Name" hideable="true" uniqueid="fi-Erv-532"/>
                            </fields>
                            <rowactions>
                                <action type="edit"/>
                                <action type="delete"/>
                            </rowactions>
                            <massactions usefirstitemasdefault="true">
                                <action type="multi" label="Select Contacts" icon="sk-icon-contact">
                                    <actions>
                                        <action type="adoptRows" sourcemodel="Contacts" targetmodel="Contacts_Wizard" affectedrows="context"/>
                                        <action type="runComponentAction" componentid="sk-Es1-636" action="navigateToStep" stepid="step2"/>
                                    </actions>
                                </action>
                            </massactions>
                            <views>
                                <view type="standard"/>
                            </views>
                        </skootable>
                    </components>
                    <actions/>
                </step>
                <step stepid="step2" steplabel="Step 2">
                    <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="Contacts_Wizard" buttonposition="" mode="read" allowcolumnreordering="true" responsive="true" uniqueid="sk-EsR-832">
                            <fields>
                                <field id="Name" uniqueid="fi-EsR-837"/>
                                <field id="Email" uniqueid="fi-EsR-838"/>
                                <field id="Account.Name" uniqueid="fi-EsR-835"/>
                            </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>
                    <actions>
                        <action uniqueid="sk-Es1-634" type="navigate" stepid="step1" label="Previous Step" icon="sk-icon-arrow-left" secondary="true"/>
                        <action uniqueid="sk-Es1-635" type="navigate" label="Next Step" icon="sk-icon-arrow-right"/>
                    </actions>
                </step>
            </steps>
        </wizard>
    </components>
    <resources>
        <labels/>
        <javascript/>
        <css/>
        <actionsequences uniqueid="sk-Erh-314"/>
    </resources>
    <styles>
        <styleitem type="background" bgtype="none"/>
    </styles>
</skuidpage>