> 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

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

```
<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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
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=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
