ERROR MESSAGE: Ampersands (&) in Conga Batch fields.


The formula fields for Conga Batch use ampersands (&) to identify parameters. If you pass to a parameter a field that might contain an ampersand, such as passing an ACCOUNT_NAME field to the OFN ("Optional File Name") parameter (for example, "Ben & Jerry's"), within the formula, it has the effect of prematurely terminating the formula and returns this error: Index outside bounds of arrays

What To Do

To prevent this from happening, Conga recommends you use the Salesforce SUBSTITUTE function to automatically substitute any ampersand with a special character string that recognizes as a substitute for ampersands (will later output the original value).

The formula below passes the Account Name field to the OFN parameter. Since some Account Name fields might contain an ampersand, the best practice is to use the SUBSTITUTE function to replace the ampersands with three ~~~ (tilde) characters:


"&OFN=Executive+Brief+-+" + Name


"&OFN=Executive+Brief+-+" + SUBSTITUTE( Name, "&", "{~~~}")

After processing the URL, will generate the output file with the original value, including any ampersand.