Skip to main content
Skip table of contents

How to display text paragraph based on a picklist in Salesforce (Legacy)

You have a picklist field in Salesforce with different values like A, B, C. The content in template will be dependent on which picklist value is selected.

For example, in Salesforce. you have a field called "Opening Words". Depending on the option, the opening text in the document will be based on those option.

image-20240109-090601.png

1. Create the text in the template

In the template, type in the text you want to display in different paragraphs

image-20240109-090607.png

2. Add condition to each paragraph

Click to the text in Option A. You will see the grey bar on the side of the text, indicating you are selecting the whole paragraph.

image-20240109-090614.png

In the right pane, click the "..." icon in If attribute

image-20240109-090621.png

The Source will open so you can select the Salesforce field to be the condition.

Select the Object and the field.

image-20240109-090627.png

Click Add condition

image-20240109-090634.png

The field API will be populated in the Condition box. Select the equation and add the picklist value you want to compare. Because it's picklist value, the criteria must be case sensitive and insde the  single quotation mark 'Option A'

image-20240109-090641.png

Click OK.

You can also write the syntax manually using Expression Language (EL).

image-20240109-090648.png

Continue the same process with other options or copy and edit the syntax in If attributes

image-20240109-090654.png

When you click to the paragraph. the grey bar on the side will turn into blue, indicating there is dynamic content in that paragraph.

image-20240109-090705.png

Notes:

  • Since we add the condition to the whole paragraph, if you want to update a new text for each Option, edit in the corresponding paragraph.

  • If you replace the whole text with a new paragraph, ensure the new paragraph has the right condition by checking the side bar and the If attribute

  • If there is no value selected in the picklist field, (value is "None"), none of the paragraph will be displayed. You can have another paragraph to be displayed when the picklist value equals to null

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.