> For the complete documentation index, see [llms.txt](https://help.sdocs.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://help.sdocs.com/sdocs/advanced-template-logic/template-attributes/template-attributes-how-to-guides/how-to-replace-values-with-different-text.md).

# How To: Replace Values with Different Text

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:**

```
<column replaceall="Burlington,Boston">AccountName</column>
```

### Solution 3: Using Regular Expressions

**Indent Lettered Lists:**

```
<column replaceall="[regex]([a-zA-Z]\)),&nbsp;&nbsp;&nbsp;&nbsp;$1">Description</column>
```

**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.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://help.sdocs.com/sdocs/advanced-template-logic/template-attributes/template-attributes-how-to-guides/how-to-replace-values-with-different-text.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
