Time
ThisYear()
Returns the current year in a 4-digit format. Used in a Template without any parameters passed between the parenthesis.
Template Entry: {{ThisYear()}}
Template Output: 2024
Today()
Returns the current date in a mm/dd/yyyy format. Used in a merge field Template without any parameters passed between the parenthesis.
Template Entry: {{Today()}}
Template Output: 1/1/2024
Now()
This function returns your local time in a HH:MM:SS AM:PM format. There is no requirement to input any parameters into the function. Current local time in your org’s time zone.
Template Entry: {{Now()}}
Template Output: 11:59:20 AM
Text
NoMerge()
Allows you to skip a merge when you don't need the field value included within a Merged Document. This can be useful when you are trying to preserve the layout of the document when merged. Simply Add the field name to be skipped between the parenthesis.
Template Entry: {{NoMerge(FieldName)}}
Template Output: The FieldName will not be merged and that section within a Merged Document will stay intact.
Lower()
Returns a merge field data value with all characters in lowercase. If the merge field data value is null, then the result is null. Used in a merge field Template by passing a FieldName between the parenthesis.
Template Entry: {{Lower(FieldName)}}
Template Output: All characters retreived from the value stored in the FieldName will be converted to lowercase.
Upper()
Returns a merge field data value with all characters in uppercase. If the merge field data value is null, then the result is null. Used in a merge field Template by passing a FieldName between the parenthesis.
Template Entry: {{Upper(FieldName)}}
Template Output: All characters retreived from the value stored in the FieldName will be converted to uppercase.
StripRichText()
Returns a merge field value in plain text. Any rich text formatting from Salesforce is removed before being placed within the Merged Document.
Template Entry: {{StripRichText(FieldName)}}
Template Output: Removes all rich text from Salesforce FieldName and outputs all characters in plain text.
Substitute()
Takes the data stored within a particular field, analyzes it, and then replaces the original text with the new text provided. Comes in handy when you need to find and replace characters within certain field values.
Template Entry: {{Substitute(FieldName, "Original", "New")}}
Template Output: Replaces the original text found within a FieldName with the new text provided. Text can be one or many characters passed to analyze and replace if a match is found.
Trim()
Removes and trims the field value to a set number of characters. This counts spaces and punctuation as part of the character count.
Template Entry: {{Trim(FieldName, NewValueTrimCharacters)}}
Template Output: Using a phone number field with this function as TRIM(Phone, 3). It would remove all other characters and keep only the first 3. Taking a value of 900-123-4567 with this function and returning only 900.
Redact()
Conceal a select number of characters within a merge field by replacing them with x's. This will take spaces, punctuation, and special characters into consideration. A great way to redact sensitive information within merge fields like employee IDs, SSN or personal information.
Template Entry: {{Redact(FieldName)}}
Template Output: If a merge field contains “Founder, CEO” it would be merged as “xxxxxxxxxxxx” using the REDACT function within a Template.
Assign A Default Value On A Merge Field
Provides the ability to take an existing field value and default it to a preset value. This way your merged documents will contain a "no value was found" at the time of the merge.
Template Entry: {{FieldName, "Default Value"}}
Template Output: If the FieldName contains a value it returns that value at the time of the merge. Otherwise it will take the "Default Value" and return that value the time of a merge.
Assign A Default Value On A Merge Field Used Within A Merge Function
Allows you to assign a default value to an existing merge field value used within a merge function when a merge field value is not found. This way your Merged Documents will contain a "Default Value" at the time of a merge.
Template Entry: {{Function(FieldName), "Default Value"}}
Template Output: Using the {{Upper(FieldName), "Default Value"}} if when converting the FieldName to uppercase no value was found it will return the "Default Value" value instead.
Math
COUNT()
When merging records within a Related List, at times, you may need to compute values such as how many records were added to a document at the time of a merge. This merge function will provide a counter letting you showcase the number records added at the time of a merge.
Template Entry: {{COUNT(RelatedListName)}}
Template Output: Once a Realted List is merged within a document it will loop and cycle through all the records it finds and meets the conditions set. Once complete, it will use a counter to determine the number of records merged into the document and return that value to the function.
SUM()
When merging records within a Related List, at times, you may need to compute values such as the total price for a particular set of products. This merge function will provide the ability to define the numerical field value that will be used within each record merged to sum up their total. Only the merged record field values will be used when computing the sum.
Template Entry: {{SUM(RelatedListName.FieldName)}}
Template Output: Once a Realted List is merged within a document it will loop and cycle through all the records it finds and meets the conditions set. Once complete, it will take the field value for each record merged and compute their sum.
AVG()
When merging records within a Related List, at times, you may need to compute values such as the average price for a particular set of products. This merge function will provide the ability to define the numerical field value that will be used within each record merged to obtain their average. Only the merged record field values will be used when computing the average.
Template Entry: {{AVG(RelatedListName.FieldName)}}
Template Output: Once a Realted List is merged within a document it will loop and cycle through all the records it finds and meets the conditions set. Once complete, it will take the field value for each record merged and compute their average.
MIN()
When merging records within a Related List, at times, you may need to compute values such as the minimum price for a particular set of products. This merge function will provide the ability to define the numerical field value that will be used within each record merged to obtain their minimum. Only the merged record field values will be used when computing the minimum.
Template Entry: {{MIN(RelatedListName.FieldName)}}
Template Output: Once a Realted List is merged within a document it will loop and cycle through all the records it finds and meets the conditions set. Once complete, it will take the field value for each record merged and compute their minimum.
MAX()
When merging records within a Related List, at times, you may need to compute values such as the maximum price for a particular set of products. This merge function will provide the ability to define the numerical field value that will be used within each record merged to obtain their maximum. Only the merged record field values will be used when computing the maximum.
Template Entry: {{MAX(RelatedListName.FieldName)}}
Template Output: Once a Realted List is merged within a document it will loop and cycle through all the records it finds and meets the conditions set. Once complete, it will take the field value for each record merged and compute their maximum.
Insert
Image()
Places an image referenced by file ID value stored within a custom field into a template. Uses the percentage values from width and height to resize the image using the same aspect ratio. Percent parameters for width and height range from (1% to 100%).
Template Entry: {{Image(CustomFieldName, Width, Height)}}
Template Output: Places the image stored in your Salesforce org called by the file ID stored within a custom text field.
ReplaceImage()
Replaces the current image in a document with the image called by the file ID stored within the custom text field.
Template Entry: {{ReplaceImage(FieldName)}}
Template Output: The current image on a document is replaced with a new image called by file ID stored within a custom text field.