Express Yourself: String Functions in Microsoft Flow

In this post, I will discuss all the String functions that can be used in Microsoft Flow. As the name implies, the functions covered in this post only apply to String data type.

Function
Description
concat
This function combines any number of strings together. It requires 2 or more parameters in the form of strings to combine into a single string.
Function: concat(text_1, text_2?,…)
Example: concat(‘string1-’,’string2-,’string3’)
Output: string1-string2-string3
Additional Examples: Click here
substring
This function returns a subset of characters from a string. It 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 parameters are numbers.
Function: substring(text, startIndex, length)
Example: substring(‘This is a short string’,10,5)
Output: short
Additional Examples: Click here
replace
This functions replaces a string with a given string. It requires 3 parameters: the base string that contains the string to be searched for using parameter 2 and then updated with parameter 3; the string to search for; and the string to replace the string from parameter 2.
Function: replace(text, oldText, newText)
Function: replace(‘This is the old string’, ‘old’, ‘new’)
Output: This  is the new string
Additional Examples: Click here
guid
This function generates a globally unique 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. The format parameter can be “N”, “D”, ‘B’, “P”, OR “x”. “D” is used by default if the format is not provided.
Function: guid()
Output: c2ecc88d-88c8-4096-912c-d6f2e2b138ce
Examples: Click here
toLower
This function converts a string to lowercase. This function only required 1 parameter, which is the string that needs to be converted to lowercase.
Function: toLower(text)
Example: toLower(‘Microsoft Flow Is AWESOME!!!’)
Output: Microsoft flow is awesome!!!
Additional Examples: Click here
toUpper
This function converts a string to uppercase. This function only required 1 parameter, which is the string that needs to be converted to uppercase.
Function: toUpper(text)
Example: toUpper(‘microsoft flow is awesome!!!’)
Output: MICROSOFT FLOW IS AWESOME!!!
Additional Examples: Click here
indexOf
This function finds the index of a value within a given string case insensitively. This function requires 2 parameters: the string that contains the value and the value to search the index of.
Function: indexOf(text, searchText)
Example: indexOf(‘Microsoft Flow’, ‘Flow’)
Output: 10 (this is the index)
Additional Examples: Click here
lastIndexOf
This function finds the last index of a value within a given string case insensitively. This function requires 2 parameters: the string that contains the value and the value to search the index of.
Function: lastIndexOf(text, searchText)
Example: lastIndexOf(‘Is this vehicle sold as-is?’, ‘is’)
Output: 24 (this is the last index of the word ‘is’, which is found in
‘as-is’)
Additional Examples: Click here
startsWith
This function checks if a string starts with a given value case insensitively. This function requires 2 parameters: the string that contains the value and the value the string may start with. The output is Boolean (true or false).
Function: startsWith (text, searchText)
Example: startsWith(‘This is Microsoft Flow’, ‘This’)
Output: true
Additional Examples: Click here
endsWith
This function checks if a string ends with a given value case insensitively. This function requires 2 parameters: the string that contains the value and the value the string may end with. The output is Boolean (true or false).
Function: endsWith (text, searchText)
Example: endsWith(‘This is Microsoft Flow’, ‘Flow’)
Output: true
Additional Examples: Click here
split
This function splits the string using a separator. This function requires 2 parameters: the string to split and the separator. In the example below, the separator is the space between the words.
Function: split(text, separator)
Example: split(‘This is Microsoft Flow’, ‘ ‘) – there’s a space between the single quotes.
Output: [“This”, “is”, “Microsoft”, “Flow”]
Additional Examples: Click here

Photo by Pankaj Patel on Unsplash

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

w

Connecting to %s