Advanced Data Gathering Using JSON Data
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.
- 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
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:Jane
Doe
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" } ] } } ] }
- 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:
- JSON data stored in the field on the Opportunity object: