For the complete documentation index, see llms.txt. This page is also available as Markdown.

How To: Replace Values with Different Text

Swap raw values for user-friendly labels with substitute and replaceAll.

Use replacement attributes when Salesforce stores codes or short values that users should not see.

Problem

You need to display user-friendly text instead of technical codes or database values.

Solution 1: substitute (Entire Value Replacement)

Replace Status Codes:

<column substitute="1,Pending,2,Approved,3,Rejected,Unknown Status">Status_Code__c</column>

Replace Boolean Values:

<column substitute="true,Yes,false,No">IsActive__c</column>

Replace with Catch-All:

<column substitute="Hot,🔥 High Priority,Warm,📊 Medium Priority,Cold,📉 Low Priority,Not Specified">Rating__c</column>

If a value does not match, it shows Not Specified.

Solution 2: replaceAll (Partial Value Replacement)

Replace Company Abbreviations:

{{!Opportunity.Name replaceAll="Inc,Incorporated,Ltd,Limited,Corp,Corporation"}}

Input: Tech Corp - Q1 2024 Output: Tech Corporation - Q1 2024

In Related Lists:

Solution 3: Using Regular Expressions

Indent Lettered Lists:

Input: a) First item b) Second item Output: a) First item b) Second item

substitute vs. replaceAll

Feature

substitute

replaceAll

Matches

Entire field value

Substrings

Catch-all

Yes

No

Regex support

No

Yes

Best for

Status codes, categories

Text cleanup, abbreviations

Tips

  • Use substitute for picklists and status values.

  • Use replaceAll for text cleanup.

  • substitute matches are case-insensitive.

  • Add [regex] to enable regular expression patterns.

Last updated

Was this helpful?