Skip to main content
Conga Support

Replace Ampersands in Reference Field Data

Conga formula fields use ampersands (&) to identify parameters.  If you reference fields that might contain ampersands as data values, you must replace the ampersands with a character string that Conga apps recognize as a substitute for ampersands: “{~~~}”.

To replace ampersands in merge fields at runtime:

  1. Use the following string to replace ampersands within merge field values at merge time:

    SUBSTITUTE (fieldname, "&", "{~~~}" )

This formula field references the Account Name field in the OFN (output file name) parameter:

"&OFN=" + Account.Name + "Case+Review"

Since some Account Names might contain an ampersand, you should replace the ampersands like this:

"&OFN=" + SUBSTITUTE (Account.Name, "&", "{~~~}" ) + "Case+Review"

In the example below, the Account.Name field for the merged record contains the company name of Merging & Batching Inc. The merge fails without substituting the ampersands within field values. With the string to substitute ampersands at merge time, however, the merge is successful, as shown in the table below:

 

Incorrect

Correct

Input

"&OFN=" + Account.Name

"&OFN=" + SUBSTITUTE (Account.Name, "&", "{~~~}" )

Result

ERROR

Merging & Batching Inc.