Text.ToList
TextReturns a list of single-character text values, one for each character in the text.
Syntax
Text.ToList(text as text) as listParameters
| Name | Type | Required | Description |
|---|---|---|---|
text | text | Yes | The text value to convert to a list of characters. |
Return Value
list — A list of single-character text values representing each character in text.
Remarks
Text.ToList splits a text value into a list of single-character elements, preserving the original order. It is the standard way to perform character-level operations in Power Query — iterating over every character in a string using list functions.
The resulting list can be processed with any list function: List.Select to filter characters, List.Transform to map over them (e.g., with Character.ToNumber), List.Count to count occurrences, or List.Accumulate for stateful processing. To reconstruct text from the list, use Text.Combine.
Text.ToList is more expressive than Text.Split for character-level work because it makes the intent clear and does not require a separator argument. It is equivalent to Text.Split only when using a delimiter that never appears in the string.
Note that Text.ToList operates on Unicode code units, not grapheme clusters. Characters that consist of multiple code units (such as certain emoji or composed diacritics) may appear as multiple list entries.
Examples
Example 2: Count occurrences of a character
let
chars = Text.ToList("alice smith"),
spaces = List.Select(chars, each _ = " ")
in
List.Count(spaces)The final output — filters the character list to keep only space characters, then counts them to find the number of spaces.
Result | |
|---|---|
| 1 | 1 |
Example 3: Get distinct characters in a string
List.Distinct(Text.ToList("Engineering"))Result | |
|---|---|
| 1 | E,n,g,i,e,r,i,n,g |
Example 4: Transform and rebuild — uppercase each character individually
Text.Combine(List.Transform(Text.ToList("alice"), Text.Upper))Result | |
|---|---|
| 1 | ALICE |