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

RebeccaRebecca Member
edited November 2018 in Questions
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

Comments

  • Matt DavisMatt Davis Skuad
    edited November 2018
    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.
  • Josef LagorioJosef Lagorio Member
    edited November 2018
    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>

  • RebeccaRebecca Member
    edited November 2018
    So im trying to recreate a screen flow from my salesforce org thats really just too many screens, the rows that are selected will then be used for the users to answer questions to. Basically you are my customer you have 4 of my products installed & its your yearly inspection or having an issue with one, my technician pulls up your work order launches hopefully the skuid page that goes through a series of steps, first is selecting which product(s) worked on it could be 1 or could be all of them and then takes the information from the row looks up the individual item and the user answers question on that item and then its repeated for the rest of the rows selected of course, Does that make sense?
  • Matt DavisMatt Davis Skuad
    edited November 2018
    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?
  • RebeccaRebecca Member
    edited November 2018
    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?
  • Matt DavisMatt Davis Skuad
    edited November 2018
    I think you could try what Mark & Erik are discussing in this conversation - https://community.skuid.com/skuid/topics/using-param-id-and-lightning
  • RebeccaRebecca Member
    edited November 2018
    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?
  • Matt DavisMatt Davis Skuad
    edited November 2018
    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.
Sign In or Register to comment.