FORMAT_STRING_TEMPLATE
Description
Parses and formats a template string by resolving embedded expressions and merge fields into standard string output.
Syntax
FORMAT_STRING_TEMPLATE(template) -> String
Parameters
| Parameter | Data Type | Required | Description |
|---|---|---|---|
| template | String | Yes | A string containing merge fields or expressions in template syntax to be evaluated and replaced with their corresponding values. Incorrect or unparseable expressions remain as literal text in the output. |
Examples
FORMAT_STRING_TEMPLATE(
'Dear {!VLOOKUP("OpportunityContactRole", "Contact.Name", "OpportunityId", Id,"IsPrimary = TRUE")},
We are pleased to inform you that your Account: {!Account.Name} has an Opportunity currently at the stage: {!StageName}.
Feel free to reach out if you have any questions.
Best Regards,
Sales Team')
Dear Kristin Stanton,
We are pleased to inform you that your Account: Owens LLC has an Opportunity currently at the stage: Prospecting.
Feel free to reach out if you have any questions.
Best Regards,
Sales TeamFORMAT_STRING_TEMPLATE('The opportunity {!Name} is currently in the {!Stage} stage.')
The opportunity Frontier Ultra Old Summit Consulting Co-Globex Q3 Upgrade is currently in the {!Stage} stage.
-- "Stage" is a typo for the field name StageName. Since DSP cannot resolve it, the expression remains unresolved in the output string.