Split function - Power Platform (2024)

  • Article

Applies to: Split function - Power Platform (1) Canvas apps Split function - Power Platform (2) Desktop flows Split function - Power Platform (3) Model-driven apps Split function - Power Platform (4) Power Platform CLI

Splits a text string into a table of substrings.

Description

The Split function breaks a text string into a table of substrings. Use Split to break up comma delimited lists, dates that use a slash between date parts, and in other situations where a well defined delimiter is used.

A separator string is used to break the text string apart. The separator can be zero, one, or more characters that are matched as a whole in the text string. Using a zero length or blank string results in each character being broken out individually. The matched separator characters are not returned in the result. If no separator match is found, then the entire text string is returned as a single result.

Use the Concat function to recombine the string without the separators.

Use the MatchAll function to split a string using a regular expression.

The examples show how Split can be used with the First and Last functions to extract a single delimited substring. The Match function is often a more concise and powerful choice for regular expressions.

Syntax

Split( Text, Separator )

  • Text - Required. Text to split.
  • Separator - Required. Separator to use in splitting the string. Can be zero, one, or more characters.

Examples

Basic usage

FormulaDescriptionResult
Split( "Apples, Oranges, Bananas", "," )Splits the different fruits apart, based on the comma separator. The split is performed based on only the comma and not the space after it, resulting in a space at the front of "Oranges" and "Bananas".A single-column table with a Value column containing the following values: "Apples", "Oranges", "Bananas"
TrimEnds( Split( "Apples, Oranges, Bananas", "," ) )Same as the previous example, but in this case the space is removed by the TrimEnds function, operating on the single column table that is produced by Split. We could have also used the separator "," which includes the space after the comma, but that wouldn't have worked properly if there's no space or there are two spaces.A single-column table with a Value column containing the following values: "Apples", "Oranges", "Bananas"
Split( "08/28/17", "/" )Splits the date apart, using a forward slash as the separator.A single-column table with a Value column containing the following values: "08", "28", "17"

Different delimiters

FormulaDescriptionResult
Split( "Hello, World", "," )Splits the words apart, using a comma as the separator. The second result starts with a space since it is the character immediately following the comma.A single-column table with a Value column containing the following values: "Hello", " World"
Split( "Hello, World", "o" )Splits the string apart, using the character "o" as the separator.A single-column table with a Value column containing the following values: "Hell", ", W", "rld"
Split( "Hello, World", "l" )Splits the string apart, using the single character "l" as the separator. Since there were no characters between both the l's in Hello, a blank value was returned.A single-column table with a Value column containing the following values: "He", Blank(), "o, Wor", "d"
Split( "Hello, World", "ll" )Splits the string apart, using the double character "ll" as the separator.A single-column table with a Value column containing the following values: "He", "o, World"
Split( "Hello, World", "%" )Splits the string apart, using the percent sign as the separator. Since this separator doesn't appear in the string, the entire string is returned as one result.A single-column table with a Value column containing the following value: "Hello, World"
Split( "Hello, World", "" )Splits the string apart, using an empty string as the separator (zero characters). This will break the string on each character.A single-column table with a Value column containing the following values: "H", "e", "l", "l", "o", ",", "", "W", "o", "r", "l", "d"

Substring extraction

FormulaDescriptionResult
First( Split( Last( Split( "Bob Jones <bob.jones@contoso.com>", "<" ) ).Result, ">" ) ).ResultSplits the string apart based on an opening delimiter (<) and extracts the string to the right of the delimiter with Last. The formula then splits that result based on the closing delimiter (>) and extracts the string the left of the delimiter with Right."bob.jones@contoso.com"
Match( "Bob Jones <bob.jones@contoso.com>", "<(?<email>.+)>" ).emailPerforms the same delimiter based extraction as the last example but uses the Match function and a regular expression instead."bob.jones@contoso.com"

Feedback

Coming soon: Throughout 2024 we will be phasing out GitHub Issues as the feedback mechanism for content and replacing it with a new feedback system. For more information see: https://aka.ms/ContentUserFeedback.

Submit and view feedback for

This product This page

Split function - Power Platform (2024)
Top Articles
Latest Posts
Article information

Author: Aracelis Kilback

Last Updated:

Views: 5792

Rating: 4.3 / 5 (64 voted)

Reviews: 87% of readers found this page helpful

Author information

Name: Aracelis Kilback

Birthday: 1994-11-22

Address: Apt. 895 30151 Green Plain, Lake Mariela, RI 98141

Phone: +5992291857476

Job: Legal Officer

Hobby: LARPing, role-playing games, Slacklining, Reading, Inline skating, Brazilian jiu-jitsu, Dance

Introduction: My name is Aracelis Kilback, I am a nice, gentle, agreeable, joyous, attractive, combative, gifted person who loves writing and wants to share my knowledge and understanding with you.