Skip to main content

How do I loop data into a table in Salesforce using AgreementGen?

With the Table Looping feature, you no longer have to manually type out lists or settle for flat text. You can now design your templates to automatically build dynamic rows or copy entire tables based on your Salesforce data arrays.

As a Salesforce Administrator and the Template Author, follow these steps to connect Salesforce with your Lumin Workspace.

Template set up

  1. Log in to your Salesforce and navigate to the Lumin Sign Admin tab.

  2. Open the Lumin Fields page.

  3. Then, head to the Collections tab.

  4. Select your parent object (Opportunity). Then, look for your child’s collection (Opportunity Line Items).

  5. Click “Building your own table?” to view repeating row markers. These need to be pasted into the first and last cells of one row in your template in AgreementGen.

Build the repeating table in AgreementGen

Open the AgreementGen editor to prepare your template layout. You can

  1. Create a table by clicking the + to insert a new table element.

  2. Ensure this has a header row and one empty body row below it.

  3. Add your chosen table headers. Then, paste the table start and end markers into the first and last rows of your table (where your chosen Salesforce data will start to populate.

  4. In the cells between your start and end markers, paste or type your field variables using the <<CollectionName.FieldName>> format:

    • Cell 1: <<TableStart:LineItems>> <<OpportunityLineItems.Name>>

    • Cell 2: <<OpportunityLineItems.Quantity>>

    • Cell 3: <<OpportunityLineItems.UnitPrice>>

    • Cell 4: <<OpportunityLineItems.Description>>

    • Cell 5: <<OpportunityLineItems.TotalPrice>><<TableEnd:OpportunityLineItems>>

💡 Tip: You can also insert flat parent variables – like the customer’s company name ({{Opportunity.Account.Name}}) outside this table to customize the document further.

Map the fields (One-time)

This step links the template you just built directly to your live Salesforce data streams.

  1. In the Lumin Sign Admin tab, scroll down to the bottom of the page and click Sync templates.

  2. Then, switch to the Lumin Sign Templates tab, open your new template.

  3. In Role Mappings, select the Salesforce Field the Signer Role must fetch data from.

  4. In Field Mappings, select the Salesforce field that the Variables must fetch data from.

  5. Then, switch to the Collections tab. Salesforce detects the collection name and field names, pre-populating the relevant Salesforce fields to fetch data based on collection variables in the AgreementGen template. Ensure the correct Salesforce fields are selected; if not, click the dropdown arrow to choose a different one.

  6. Then, click Save mappings.

  7. Finally, switch to the Signature request settings tab to activate template mapping, set the default sign-by period, and set the download behavior when the signature is completed.

Did this answer your question?