How to deploy Conga Composer configuration using Salesforce CLI plugins

Nicolas Vuillamy
5 min readJul 14, 2024

--

I sometimes help on Cloudity projects as Release Manager, and I had to deploy Conga Composer configuration using CI/CD.

When I saw the hardcoded record Ids in the url of custom buttons, I started to get a little bit crazy , because creating dependencies between data and metadata is a very bad practice that we teach our juniors to avoid !

Then Conga contacted me and I had a very interesting session with Rodolphe Malaguti, who explained to me everything I needed to know to configure, collect and deploy items necessary to transfer Conga Composer configuration from one org to another, using Git-based deployments.

Composer configuration

You do not need to use hardcoded Ids, use Conga Keys !

On every conga configuration record (Template, Query, Email Template, Solution), you have an auto-populated field named Key.

Use it in your Conga custom buttons and Conga Solutions !

Conga Keys used in custom conga button

Retrieve Conga Composer Items

Conga Configuration is the association of 3 different types of elements.

  1. Metadata: WebLinks (Custom Buttons defined on objects), Flexipages where Custom Buttons or Conga Solutions Component are embedded
  2. Data: Records corresponding to objects: APXTConga4__Conga_Template__c, APXTConga4__Conga_Merge_Query__c, APXTConga4__Conga_Email_Template__c, APXTConga4__Conga_Solution__c (there are probably more, but I don’t need them on my project: please comment this article to complete :) )
  3. Files: Word templates associated to APXTConga4__Conga_Template__c records
All files corresponding to Conga configuration

(1) Retrieve Metadata

We won’t explain you how to retrieve/deploy metadatas: use the tool you prefer for that ! (sfdx-hardis, Salesforce CLI, DevOps Center, 3rd party vendors DevOps tools…)

Example of Conga custom button with WebLink
  • Weblinks
  • Flexipages with Conga custom buttons or embedding Conga Solutions Lightning component

(2) Export Conga records

You can use free and open-source tools sfdx-hardis and SFDMU to retrieve all Conga records.

If you don’t have sfdx-hardis on your computer, please follow the installation instructions in the video tutorial

Click on menu Data & Files -> Create Data Import/Export Configuration, then select template CongaComposer.

Create Data Export folder using CongaConfig Template

If will generate a data folder with an export.json file containing the following text.

{
"sfdxHardisLabel": "Conga Configuration",
"sfdxHardisDescription": "Will export/import Conga config (Templates, Queries, Email Templates, Solutions)",
"objects": [
{
"query": "SELECT all FROM APXTConga4__Conga_Template__c",
"operation": "Upsert",
"externalId": "APXTConga4__Key__c"
},
{
"query": "SELECT all FROM APXTConga4__Conga_Merge_Query__c",
"operation": "Upsert",
"externalId": "APXTConga4__Key__c"
},
{
"query": "SELECT all FROM APXTConga4__Conga_Email_Template__c",
"operation": "Upsert",
"externalId": "APXTConga4__Key__c"
},
{
"query": "SELECT all FROM APXTConga4__Conga_Solution__c",
"operation": "Upsert",
"externalId": "Name"
}
]
}

Click on menu Data & Files -> Export Data from org with SFDMU , and when prompted, select CongaComposer data project.

Export conga records using sfdx-hardid & SFDMU

If you are on a CI/CD project, stage and commit export.json + the generated .csv files.

(3) Export template files

You can again use free and open-source tool sfdx-hardis to retrieve all template files.

Click on menu Data & Files -> Create Files Import/Export Configuration, then select template CongaTemplates.

Create files export folder using template CongaTemplates

It will generate a folder CongaTemplates with the following export.json file.

{
"sfdxHardisLabel": "Conga Template files for Conga configuration",
"sfdxHardisDescription": "Export attachments related to conga templates",
"soqlQuery": "SELECT Id,Name,APXTConga4__Key__c FROM APXTConga4__Conga_Template__c",
"fileTypes": "all",
"outputFolderNameField": "APXTConga4__Key__c",
"outputFileNameFormat": "title",
"overwriteParentRecords": true,
"overwriteFiles": true
}

Click on menu Data & Files -> Export Files from org, and when prompted, select CongaComposer data project.

If you have multiple word files, delete all of them except the most recent one, which is corresponding to the template file you want to use.

Export Conga Template files using sfdx-hardis

If you are on a CI/CD project, stage and commit export.json + the downloaded .doc / .docx files.

Deploy Conga Composer items

Now you have collected all items related to conga configuration (Metadatas, records and files) you can now import them in the target org !

(1) Deploy Metadata

Again, we won’t explain you how to retrieve/deploy metadatas: use the tool you prefer for that ! (sfdx-hardis, Salesforce CLI, DevOps Center, 3rd party vendors DevOps tools…)

  • Weblinks
  • Flexipages with Conga custom buttons or embedding Conga Solutions Lightning component

(2) Import Conga records

Click on menu Data & Files -> Import Data to org with SFDMU , and when prompted, select CongaComposer data project.

Import conga records using sfdx-hardis & SFDMU

You can automate this action in your CI/CD workflows using the following command line.

sfdx sfdmu:run --sourceusername csvfile --targetusername YOUR_TARGET_USERNAME -p scripts/data/CongaConfig --noprompt

Note: Add — canmodify option if the target is on a production org

(3) Import template files

Click on menu Data & Files -> Import files into org , and when prompted, select CongaTemplates file project.

You can automate this action in your CI/CD workflows using the following command line.

sfdx hardis:org:files:import --path scripts/files/CongaTemplates --targetusername YOUR_TARGET_USERNAME

Conclusion

With Conga Keys, sfdx-hardis & SFDMU, you can easily export then import Conga configuration from one org to another, and automate it within your CI/CD pipelines !

Sign up to discover human stories that deepen your understanding of the world.

Free

Distraction-free reading. No ads.

Organize your knowledge with lists and highlights.

Tell your story. Find your audience.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

--

--

Written by Nicolas Vuillamy

Open-Source addict and CTO at Cloudity. Creator of MegaLinter, npm-groovy-lint & sfdx-hardis

Responses (1)