Conga Composer can consume Key-Value pairs stored in Salesforce fields as JSON strings to merge JSON data into a Composer template along with Salesforce field data and External data

Important

  • This release only supports Microsoft Word and Conga Email templates.
  • It is only supported in Classic Composer buttons.
  • It is not supported in Salesforce Mobile solutions.
  • JSON values and Salesforce field values cannot currently be included in the same tables.
  • It is not supported with Conga Batch and Conga Trigger.

To merge JSON data

  1. Include the FieldDataSource parameter into your Composer Solution or Button.
  2. Use the Template Builder to add JSON merge fields to the template or add JSON merge fields manually in the format "{{jsonkey}}" to the template.

    For merging the JSON values, you must include a TableStart and TableEnd (which are not always required in Word Table).

    As shown below, a merge table includes TableStart with the FieldDataSource and the jsonkey representing the JSON child field name for the FieldDataSource JSON data.

    {{TableStart:FieldDataSource}}

    {{jsonkey}}

    {{jsonkey}}

    {{TableEnd:FieldDataSource}}

    Using the query parameter FieldDataSource=JSON Attributes, with child fields insuredFirstName and insuredLastName, the resulting table configuration would be:

    {{TableStart:JSON_Attributes__c}}

    {{insuredFirstName}}

    {{insuredLastName}}

    {{TableEnd:JSON_Attributes__c}}

    TableStart and TableEnd are the constant merge field tags, and JSON_Attributes__c is the source field API name and key for the table. The jsonkey's are replaced with the desired JSON child field names, such as insuredFirstName and insuredLastName.

    FieldDataSource is a comma-separated parameter. Be sure to use the corresponding field API name from the parameter in the merge table configuration after TableStart and TableEnd.

Examples:

The following examples show the output for the different scenarios for the above configuration for master objects and child objects as the location for the FieldDataSource.

Example 1:
As shown below, a field called
JSON Attributes (API Name: JSON_Attributes__c) on the master object is the source for the JSON data (FieldDataSource) merge field for the Setup configuration:

  • JSON data stored in the field:

    Master Object Field

    (FieldDataSource)

    Master Object Field Value

    (JSON Data)

    JSON Attributes"StepPrimaryDriverInfo":{"insuredLastName":"Doe", "insuredFirstName":"Jane"}
  • Table configuration for the template merge table:

    {{TableStart:JSON_Attributes__c}}

    {{insuredFirstName}}

    {{insuredLastName}}

    {{TableEnd:JSON_Attributes__c}}

  • Composer Solution merges the value Jane into {{insuredFirstName}} and Doe into {{insuredLastName}}. The resulting table is:

    JaneDoe

Example 2:
As shown below, a field called JSON Attributes (API Name: JSON_Attributes__c) is the source of the JSON data (FieldDataSource) merge field for the Setup configuration:

    • JSON data stored in the field on the Opportunity object:

      {
        "portfolio": [
          {
            "recommended": {
              "FullName": "Recommend Products",
              "ExecutiveSummary": "The products below are ASAP Corporations recommendations for products that exceed your requirements, but have much more reliability and lifetime warranty.",
              "whereSold": {
                "zones": [
                  {
                    "zone": "NA"
                  },
                  {
                    "zone": "EU"
                  },
                  {
                    "zone": "AP"
                  }
                ]
              },
              "products": [
                {
                  "type": "prem",
                  "name": "Hydro Flask Water Bottle",
                  "quantity": "8",
                  "price": "50",
                  "total": "400"
                },
                {
                  "type": "prem",
                  "name": "Protective Silicone Boot",
                  "quantity": "8",
                  "price": "10",
                  "total": "80"
                }
              ]
            }
          },
          {
            "standard": {
              "FullName": "Standard Products",
              "ExecutiveSummary": "These products meet your minimum requirements, but do not offer the same reliability and only 1 year warranty.",
              "whereSold": {
                "zones": [
                  {
                    "zone": "NA"
                  }
                ]
              },
              "products": [
                {
                  "type": "std",
                  "name": "Wide Mouth - Hydro Flask 32 oz",
                  "quantity": "8",
                  "price": "25",
                  "total": "200"
                },
                {
                  "type": "std",
                  "name": "Wide Mouth - Hydro Flask protection cup for 32 oz",
                  "quantity": "8",
                  "price": "5",
                  "total": "40"
                }
              ]
            }
          }
        ]
      }
      CODE
    • Table configuration for the template merge table:

      Important

      To merge the details from the Child Object, you must use UNDERSCORE with the Salesforce field. (for example, Salesforcefield_ChildObject).

    • Composer Solution:
    • Merged Document: