Power Automate Desktop Text Actions [With Examples]

Power Automate Desktop provides various text actions that allow to manipulate, extract, and work with text in a variety of ways. In this tutorial, I will explain various Power Automate Desktop text actions with examples.

I will cover the following desktop actions:

  • Append line to text
  • Get subtext
  • Crop text
  • Pad text
  • Trim text
  • Reverse text
  • Change text case
  • Create random text
  • Split text
  • Replace text

Text Actions in Power Automate Desktop

Here, I will explain a list of all Power Automate Desktop text actions, along with their parameters, using one example for each.

Append line to text

It is useful when you want to combine information into a single text or a variable. This action adds a new text line to a single text value or list of text values.

Input Parameters:

  • Original text: The original text to which the text should be added.
  • Line to append: The new text value to add on as a new line.

Output:

It produces the ‘Result‘ variable that has the value of the combined text value of the original text in a new line.

Example:

Suppose I have a text value in a variable as ‘Product ID: P1025 | Name: Bluetooth Speaker‘. Then, I wanted to append a new text [Stock Updated To: 150 units] to the original string.

Text Actions Power Automate Desktop

Input:

Power Automate Desktop Text Actions

Output:

Append line to text PAD

See Connect Power Automate Desktop to Cloud

Get Subtext

It retrieves the subtext from a text value, specifying the start index and length of the text. With this action, you can extract a specific portion of text or a list of text values.

Parameters:

ParameterOptions AvailableDefault ValueDescription
Original textText variable from where the subtext is retrieved.
Start indexStart of text,
Character position
Character positionSelect one option to specify the starting point for text retrieval.
Character positionNumeric valueEnter the position of the character to retrieve text. Zero-based index, count zero from the first character.
LengthEnd of text,
Number of chars
Number of charsChoose one option: whether the subtext continues at the end of the text or includes only certain characters.
Number of charsNumeric valueThe number of characters to retrieve

It produces ‘Subtext’ as a variable that stores the retrieved subtext value.

Example:

Suppose I took a text variable with the value ‘Power Automate Desktop Flows. From the text, I want to get the subtext ‘Desktop Flows‘.

Input:

Get subtext in Power Automate Desktop

Output:

PAD Get Subtext action

Crop text

This action retrieves the text value that occurs before, after, or between the specified text values from the original text string.

Input Parameters:

ParameterOptions AvailableDefault ValueDescription
Original textOriginal text string from which you can crop the part of the text.
Mode
Get text before the specified flag,
Get text after the specified flag,
Get text between the two specified flags
Get text before the specified flagChoose the option whether to retrieve the text before, after, or between flags.
Start flagText valueThe cropped text will be after this flag.
End flagText valueThe retrieved text will be before this end flag.
Ignore caseBoolean valueToggle offIt finds the case-sensitive or case-insensitive text values.

It produces the CroppedText variable, which contains the new cropped text value.

Example:

Let me take a text string as ‘Power Automate Desktop Flows’. From this, I want to crop the ‘Power Automate‘ string from the original text string. Specify the parameters, such as Original text, Mode, and End flag.

Power Automate Desktop Text Actions

Output:

PAD Crop text action

Check Variables in Power Automate Desktop

Pad text

In desktop flows, the Pad text action creates a fixed-length text by adding characters to the left or right of the provided original text.

With this, you can add white spaces, words, or phrases before or after the text or list of text values.

Input Parameters:

  • Text to pad: Select the text variable that you want to increase in length.
  • Pad: Option to add padding to the left or right side of the text.
  • Text for padding: The text or character added to increase the length of the original text.
  • Total length: The total character length of the final padded text.

It provides the ‘PaddedText‘ variable, which contains text with padded characters.

Example:

Let’s take the example of ‘Product Code’, such as ‘X9Zj32‘. You can increase the length of this product code by using the Pad text action.

Here, you can lengthen the Product code text by adding characters to it. I wanted to display it as ‘****X9Zj32‘ with the length of 10 characters.

Pad text action in Power Automate Desktop

Output:

Power Automate desktop string manipulation

Trim text

This action removes all occurrences of white spaces, such as spaces, tabs, and new lines, from the beginning and end of a text.

Input Parameters:

It has a ‘What to trim‘ parameter with the following options. You can specify where white space characters will be removed from the text.

  • whitespace characters from the beginning
  • whitespace characters from the end
  • whitespace characters from the beginning and end

It will produce the ‘Trimmedtext‘ variable that stores the new trimmed text.

Example:

If you have a string with white spaces at the beginning and end of the text, as shown in the image below.

Product ID: P1025 
            Name: Bluetooth Speaker
Trim Text action in Power Automate Desktop

You can erase them by using the trim text action in Power Automate Desktop.

Input:

Power Automate Desktop Trim text action

Result:

Power Automate Desktop Trim text

Reverse text

This text action in Power Automate desktop reverses the left and right sides of a text string. It reverses the order of letters in a text string. It produces the ‘ReversedText‘ variable.

Parameter:

  • Text to reverse – Provide the text variable or enter the text to reverse.

For example, the reverse of ‘Power Automate‘ -> ‘etamotuA rewoP‘.

Power Automate Reverse Text action

Result:

Power Automate Reverse action desktop

Change text case

You can use the Change text case action in Power Automate desktop to convert the case of text values.

The text string can be changed into uppercase, lowercase, title case (where every word starts with a capital letter), or sentence case.

Parameters:

  • Text to convert: Provide the text that needs to be changed.
  • Convert to: Choose case style from Upper case, Lower case, Title case, Sentence case options.

Example:

I will use a text string as ‘power platform’. Then, it will produce the output based on the selected text case conversion option.

Power Automate change text case action

Output:

  • Upper case – POWER PLATFORM
  • Lower case – power platform
  • Title case – Power Platform
  • Sentence case – Power platform
Power Automate Desktop Change text case option

Learn Data Table in Power Automate Desktop

Create random text

This action is mainly used to create passwords. It generates a specific length of text consisting of random characters.

You can define the parameters that are included in the password, like uppercase, lowercase, digits, and symbols.

  • Minimum length: Specify the minimum length of random text.
  • Maximum length: Specify the maximum length of a password.

Note:

If the minimum and maximum lengths are different, password length will be random in between the min and max values.

Power Automate Desktop Text Functions

Result: Generated Password

Create random text action Power Automate Desktop

Learn Data Table in Power Automate Desktop

Split text

Power Automate desktop split text action will split the text string into a list of substrings separated by a specific delimiter. In this, you can choose standard delimiters (Space, Tab, and Newline) or custom delimiters.

The split text action produces the ‘TextList’ variable that stores a new list of items.

Parameters:

  • The text to split: Enter a value or provide a text variable that needs to be split.
  • Delimiter type: You can choose between standard and custom type.
  • Custom delimiter: Provide the delimiter.

Is regular expression is a toggle button that can be used when you want to specify the regular expression as a delimiter. For example: ‘\ d means that the delimiter could be any digit.

Example:

Suppose I take a text string as ‘Power Automate, Power BI, Power Apps, Power Virtual Agents’.

Power Automate Desktop Split text action

Here, the text will be split by (,) as a delimiter and produce a list of items.

Split text action in Power Automate desktop

Replace text

Power Automate’s desktop replace text action identifies a string in a text and replaces all occurrences with another string or character.

Input Parameters:

Input Parameters:

ParameterDefault ValueDescription
Text to parseOriginal text string in which you want to replace the text.
Text to findThe substring or a regular expression to search
Use regular expressions for find and replaceFalseSpecify whether the subtext to find is a regular expression.
Ignore caseFalseToggle on if you want to find subtext that is case-sensitive.
Replace withProvide the text or regular expression to be replaced with.
Activate escape sequencesFalseSpecify whether to use special sequences. Ex: ‘\t’ in the replacement text will be interpreted as a tab.

The variables produced from this action will be ‘Replaced‘, which consists of new updated text.

Example:

I will manually enter a text string that represents the contact email of our Organization [[email protected]]. Now, I wanted to replace the text ‘tsinfotech‘ with ‘tsinfotechnologies‘.

Replaced text action Power Automate Desktop

Output: Replaced text

Replace text action Power Automate Desktop

While working with the desktop flows in Power Automate, many of these actions help format the text to maintain uniform data.

In this tutorial, I explained how to use various text actions in Power Automate Desktop with real examples.

Also, you may like:

>

Build a High-Performance Project Management Site in SharePoint Online

User registration Power Apps canvas app

DOWNLOAD USER REGISTRATION POWER APPS CANVAS APP

Download a fully functional Power Apps Canvas App (with Power Automate): User Registration App

Power Platform Tutorial FREE PDF Download

FREE Power Platform Tutorial PDF

Download 135 Pages FREE PDF on Microsoft Power Platform Tutorial. Learn Now…