Conditionally include template files

You can set up template files to be conditionally or dynamically included in DocGen Packages based on Salesforce data.

To conditionally include template files:

  1. Open or Create a DocGen Package.
  2. Select the Documents tab.
  3. Do one of the following to edit the DocGen Package:
    • Click Down arrow and select Edit.
    • Select Edit next to the field you want to edit in the package.
  4. Under Include Template, select Conditionally.
  5. Set up the data field and value as follows:
    Include section if <<Tag1>>
    Equals TagValue1
    1. Select Include/exclude section if and specify which field to evaluate by entering a tag from the Field Tagger.

    2. Select Equals/does not equal or another option and enter the value you want to evaluate the selected tag with.

      Note: This value can be static or dynamic. You can make this value dynamic by entering a tag from the Field Tagger.

    AND logic (multiple conditions)

    It is possible to include/exclude templates based on multiple conditions. Set up the tag and value fields as follows:

    Include section if <<Tag1>><<Tag2>>

    Equals TagValue1TagValue2

    OR logic (single tag)

    Separate the values in the value section with a comma:

    Include section if: <<Tag1>>

    Equals: TagValue1, TagValue2

    OR logic (multiple tags)

    Enter multiple tags in the data field and separate the values in the value section with a comma:

    Include section if: <<Tag1>><<Tag2>>

    Equals: TagValue1, TagValue2, TagValue3

  6. Select the Available as Email Body for Delivery option if you want the file to be available as the email body when it is delivered.
  7. Click Save

Example:

Include section if <<Opportunity_Stage>>

Equals Prospecting

If the values above are selected under the Conditionally option, the template will be included in the output only if the Stage field on the Opportunity object is set to Prospecting. If the Stage field in the Opportunity object is equal to Closed Won instead, the template will not be included in the output when you run the DocGen Package.