Export Child Relationship Template Field

  • 1
  • Question
  • Updated 4 years ago
  • Answered
Is it possible to export a child relationship? We can show it in a template field on the table, but I do not see a way to add it to the export columns. 
Photo of Amish Ranjit

Amish Ranjit

  • 192 Points 100 badge 2x thumb

Posted 4 years ago

  • 1
Photo of Karen Waldschmitt

Karen Waldschmitt, Official Rep

  • 9,332 Points 5k badge 2x thumb

What if you have the model of the table be the child object and bring in the appropriate fields from the parent object?

Photo of Rob Hatch

Rob Hatch, Official Rep

  • 45,308 Points 20k badge 2x thumb
Amish.  Enclosed below is a page that shows Accounts,  and then has a child relationship on Contacts.   This is replicated in the export columns (so that you could remove the contacts from the table and still have the data export). 

<skuidpage unsavedchangeswarning="yes" showsidebar="true" showheader="true" tabtooverride="Account" personalizationmode="server">    <models>
        <model id="Account" limit="100" query="true" createrowifnonefound="false" sobject="Account">
                <field id="Name"/>
                <field id="CreatedDate"/>
                <field id="Contacts" type="childRelationship" limit="" orderby="LastName, FirstName">
                        <field id="FirstName"/>
                        <field id="LastName"/>
        <pagetitle model="Account" uniqueid="sk-31XNxr-69">
                <action type="savecancel"/>
        <skootable showconditions="true" showsavecancel="false" searchmethod="server" searchbox="true" showexportbuttons="true" pagesize="10" createrecords="true" model="Account" mode="read" uniqueid="sk-31XNxr-70">
                <field id="Name" allowordering="true"/>
                <field id="CreatedDate" allowordering="true"/>
                <field id="Contacts" type="CHILDREL" limit="100" valuehalign="" delimiter="&lt;br/&gt;">
                    <template>{{FirstName}} {{LastName}}</template>
                <action type="edit"/>
                <action type="delete"/>
            <massactions usefirstitemasdefault="true">
                <action type="massupdate"/>
                <action type="massdelete"/>
                <view type="standard"/>
            <exportproperties usetablecolumns="false" loadallrecords="true" filename="AccountsWithContacts.csv" appendrowidcolumn="false">
                    <column type="field" headertype="fieldlabel" field="Name"/>
                    <column type="field" headertype="fieldlabel" field="CreatedDate"/>
                    <column type="template" headertype="fieldlabel">
                        <template>{{#Contacts.records}}{{FirstName}} {{LastName}}, {{/Contacts.records}}</template>
        <styleitem type="background" bgtype="none"/>