The Split function in Power Apps is a powerful tool that allows you to break a text string into a table of substrings.
This is especially useful when you want to process or display text in smaller, manageable parts.
To achieve this, you define a separator—a character or string that determines where the text should be split.
Basic Example
Imagine you have a label containing the following text:
Carpe diem seize the day. Make your lives extraordinary.
This is a quote from the Dead Poets Society movie.
By applying the Split function to this label’s text, you can break it into separate parts. For instance:
Split(Label2.Text, ".")
This will split the string wherever a dot (.) appears, returning a table of substrings.
Since the result is a table, a gallery control is often used to display the output.
Using Different Separators
The separator can be customized to fit your needs. Here are some examples:
- Dot (.): Splits sentences at each period.
- Comma (,): Splits text at commas. If none exist, you can add one to see the effect.
- Blank Space (” “): Splits text into individual words.
- Single Character (e.g., “A”): Splits text whenever the letter “A” appears.
- Multiple Characters (e.g., “dim”): Splits text whenever the sequence “diem” is found.
- Nonexistent Character: If the separator doesn’t exist in the text, the string remains unsplit.
Special Case: Splitting by Nothing
If you use an empty string ("") as the separator, the function will split the text into individual characters, including spaces.
This can be useful when you need to analyze or manipulate text at the character level.
Why Use a Gallery?
Since the Split function returns a table, a
is the perfect way to display the results.
Each row in the table corresponds to a substring, making it easy to visualize and work with the split data.
Conclusion
The Split function in Power Apps is versatile and allows you to break down text in many different ways depending on the separator you choose.
Whether you’re splitting sentences, words, or even characters, this function provides a simple yet powerful way to manipulate text for your applications.

Leave a Comment