Power Automate String Functions + 10 Examples

In this Power Automate tutorial, we will discuss Power automate String Functions with a few examples. And also we will discuss the below Points:

  • Introduction to string Function in Power Automate.
  • List of String Function In power Automate
  • Examples Of string Function in Power Automate
  • Power automate limit string length

Introduction to String Function in Power Automate

The string Function in Power Automate is used to convert strings, string characters, format the string, and many more.

Whereas text modification is a basic technique that is used extensively in an attempt to format better or convert data to other sources.

List of String Function In Power Automate

Here we will discuss the list of String Functions used in Power Automate with description and Syntax.

String FunctionDescriptionSyntax
concatIn Power Automate this flow combines any number of strings together. This function requires more than one parameter in the form of a string to combine into a single stringconcat(text 1, text 2. text 3)
substringThis function in Power automate returns a subset of characters from a string. This function requires 3 parameters: the string from which the substring is taken; the index where the substring begins; and the length of the substring. The last two-parameter of the function is number. substring (text, startIndex,length)
replaceThis function is used to replace a string with a given string. So, it requires 3 parameters: the base string that contains the string to be searched for using parameter 2 and then updates the parameter 3; the string to search for; at last the string to replace the string from parameter 2. replace (text, old text, new text)
guidThis function is used to generate a global unit string (GUID). An example of this function is if a document requires a unique id. It contains an optional parameter, which is a single format specifier that indicates how to format the GUID guid ()
toLowerThis function is used to convert a string to Lowercase. Functions require only 1 parameter i.e. the string needs to be converted to Lower case toLower (text)
toUpperThis function is used to convert a string to uppercase. Functions only require one parameter, which is the string that needs to be converted to uppercase. toUpper (text)
indexOfThis function is used to find the index of a value within a given string case insensitivity. And the Function requires only two parameters: the string that contains the value and the value to search the index of.indexOf(text, searchText)
lastIndexOfThis function is used to find the last index of a value within a given string case insensitivity. And the functions require 2 parameters i.e. the string that contains the value and the value to search the index of. lastIndexOf (text, searchhText)
startsWithThis function is used to check if a string starts with a given value case insensitivity. And this function requires 2 parameters i.e. the string that contains the value and the value the string may start with. The output is boolean i.e. True and False. startsWith (text, searchText)
endsWithThis function is used to check if a string ends with a given value case-insensitively. This function requires 2 parameters i.e. the string that contains the value and values the string ends with. The output is Boolean (True and False). endsWith (text, search Text)
splitThis function is used to split the string using a separator. And this function requires 2 parameters i.e. the string to split and the separator.split(text, separator)
lengthThis function returns the number of character present in a string.length(text)

Read Convert SharePoint document to PDF using Power Automate

Examples Of string Function in Power Automate

Here we will discuss the list of Power Automate string functions with examples.

Example 1: Power Automate String concat function

Here we will see how to use string function concat in the Microsoft Flow or Power Automate.

In Power Automate, select manually trigger flow. Then click on the Next step.

flow string function
flow string function

Select the initialize variable action, set the variable name as the First name, and type as String. Then set the value as per your requirement.

power automate string functions concat
power automate string functions concat

Then click on Next step, and select initialize variable action. Next set the variable name as LastName, type string, and provide a value.

power automate string functions concat
power automate string functions concat

Now click on the next step and select Compose action. In the input box add the below expression:

concat(variables('FirstName'),variables('LastName'))
power automate string functions concat
power automate string functions concat

Now click on Save and Run the Flow. We can see the result in the output of Compose action that is both the string concatenated.

power automate string functions concat
power automate string functions concat

Read Microsoft Flow Example: Copy files from one SharePoint Online account or folder to another

Example 2: Using Power Automate Substring function

Here we will see how to use the substring function in the Power Automate.

In Power Automate select manually trigger flow. Click on the Next step.

power automate substring function
power automate substring function

Select the Initialize variable action and then set the variable as name, type as string, and set the value.

power automate substring function
power automate substring function

Then add the compose action to get the substring ‘Watson’ from string ‘Emma Watson’.

So, click on the next step, select compose action and then in the input box add the below expression to get the substring:

substring(variables('Name'),5,6)
power automate substring
power automate substring

Now click on save and run the flow. We will see the result in the output of compose action.

power automate substring function
power automate substring function

Read Move files from OneDrive for Business to SharePoint Online

Example 3: Using Power Automate string replace function

Here we will see how to use replace string function in Microsoft Flow or Power Automate.

In Power Automate select the manually triggered flow and click on Next step.

power automate string functions replace
power automate string functions replace

Select the initialize variable action, then set the variable name, Type as a string, and set the value below.

power automate string functions replace
power automate string functions replace

Now we will replace a string ‘ Watson’ with another string ‘Bidden’.

So, click on the next step, and then select the ‘Compose’ action. In the input box write the below expression:

replace(variables('Name'),'Watson','Bidden')
power automate string functions replace
power automate string functions replace

Now click on the save and run the flow, you can see the result in the compose output.

power automate string replace
power automate string replace

Read Unable to process template language expressions in action Power Automate

Example 4: Using Power automate string toLower function

Here we will see how to use the toLower string function in Power automate.

In Power automate select Manually triggered flow and then click on Next Step.

List of power automate string functions
List of power automate string functions

Select the initialize variable action, and then set the name, type as string, and value.

flow string function toLower
flow string function toLower

Now we will convert the whole string to lower case and similarly you can change it to uppercase.

Then click on the Next step and select the Compose action. In the input box add the below expression.

toLower(variables('Name'))
flow string function toLower
flow string function toLower

Now click on Save and run the flow. we can see the result in the output of the Compose action in Microsoft Flow.

flow string function toLower
flow string function toLower

Read Power Automate update SharePoint list item

Example 5: Using Power Automate string indexOf function

Here we will see how to use the string indexOf function in Microsoft Flow.

In Power automate select the manually triggered flow and click on the next step.

flow string function
flow string function

Select the initialize variable action, and then set the variable name, type as string, and value.

power automate string function indexof
power automate string function indexof

Now we will get the index of substring Watson from string ‘Emma Watson’ by using the indexOf function.

indexOf(variables('Name'),'Watson')
power automate string function indexof
power automate string function indexof

Now save and run the flow manually, we can see the result in the compose output.

power automate string function indexof
power automate string function indexof

Read Trigger Conditions in Power Automate

Example 6: Power Automate string lastIndexOf function

Here we will see how to use the string lastIndexOf function in Microsoft Flow.

In Power Automate select the manually triggered flow and click on the next step.

 power automate string functions
power automate string functions

Select the initialize variable action and then set the variable name, type as a string, and the value.

 power automate string functions
power automate string functions

Now click on Next step, and then select compose action. In the Input add the below expression:

lastIndexOf(variables('Name'),'Watson')
power automate string function lastindexof
power automate string function lastindexof

Now click on Save and run the flow manually, then see the result in the compose output.

power automate string function lastindexof
power automate string function lastindexof

Read Power Automate Forms to Excel

Example 7: Using Power automate startsWith string function

Here we will see how to use startsWith function in the Microsoft flow.

Select the Manually triggered flow in Power Automate. Click on the Next step.

 Using Power automate startWith function
Using Power automate startWith function

Now select initialize variable action, then set the variable name, type as string, and value.

flow string function
flow string function

Here we will search the text from the string, if it is found then startwith() return true or else false.

So, click on the Next step and then select compose action. And in the input box add the below expression:

startsWith(variables('Name'),'Emma')
power automate string functions startsWith
power automate string functions startsWith

Now click on Save and run the flow, and check the result in the compose output.

power automate string functions
power automate string functions

Read Power Automate create an HTML table

Example 8: Using Power automate endWith string function

Here we will see how to use endsWith function in the Microsoft Flow.

In the Power Automate select the manually triggered flow. Click on Next Step.

How do you use string in power automate?
How do you use string in power automate?

Select the initialize variable, then set the variable name type as string and value.

power automate string functions
power automate string functions

Now we will check in the string whether the text ends with that text or not, then the endsWith function will return true else return false.

After that click on the Next step, choose the compose action. In the input write the below expression:

endsWith(variables('Name'),'Watson')
Microsoft Flow string functions endsWith
Microsoft Flow string functions endsWith

Now click on the save and run the flow manually. we can see the result in the compose action.

power automate string functions endsWith
power automate string functions endsWith

Read Power Automate Switch case

Example 9: Using Power Automate string split function

Here we will see how to use split function in the Power Automate or Flow.

In the Microsoft Flow select the manually triggered flow. Then click on the Next step.

  Microsoft flow string function
Microsoft flow string function

Select the initialize variable action and then set the variable name, type as string and values.

  flow string function
flow string function

Now we will split the string using a separator space ” ” using split function.

So, click on the next step, then select the compose action and in input box add the below expression:

split(variables('Name'),' ')
power automate string functions split
power automate string functions split

Now click on the Save and run the flow manually. We can see the result in the compose output.

power automate string functions split
power automate string functions split

Read Power Automate send an email with an attachment from SharePoint

Example 10: Using Power Automate string length function

Here we will see how to uselength function in Power automate or Microsoft flow.

Select manually triggered flow in the Power automate and then click on the Next step.

 power automate string functions
power automate string functions

Select the initialize variable action, then set the variable name, type as string, and value.

power automate length of string
power automate length of string

Now we will find the length of the string by using the length function in Microsoft flow.

So, click on the Next step, the select the compose action. In input write the below expression:

length(variables('Name'))
power automate string length
power automate string length

Now click on Save and run the flow manually, we can see the result in the compose action.

power automate length of string
power automate length of string

Read Power automate approval reminder

Power Automate limit string length

Here we will see how to limit the string length up to 256 characters in Power Automate.

In Power automate click on the Manually triggered flow. Then click on the Next step.

power automate limit string length
power automate limit string length

Select the compose action, here in input box we will add some dummy text like below:

power automate limit string length
power automate limit string length

Now we will check the output of the compose action is greater than 256 characters, then grab the 256 characters else output the whole string.

So, for this click on the next step, then select compose action, and in input write the below expression:

if(greater(length(outputs('Compose')), 256),
substring(outputs('Compose'), 0,256),outputs('Compose'))
power automate limit string length
power automate limit string length

Now click on save and run the flow. we can see the result in the compose output.

power automate limit string length
power automate limit string length

You may like the following Power Automate tutorials:

In this Power Automate tutorial, we learned different string functions in Power Automate or Microsoft Flow. And also we discuss the below points:

  • Introduction to string Function in Power Automate.
  • List of String Function In power Automate
  • Examples Of string Function in Power Automate
  • Power automate limit string length
>