slice function.(Power Automate Cloud flows)

Japanese version.

Function to cut out an arbitrary start-to-end substring from the specified text.

It is similar to the substring function, but differs in the specification of how far to cut out.

  • The substring function is the number of characters.
  • The slice function is a position.

Spec

slice('<text>', <startIndex>, <endIndex>)
ArgumentDefaultDescription
textRequired fieldSource text of the cutout.
startIndexRequired fieldThe starting position of the cutout.
Top is 0.
endIndexFrom "startIndex" to the end of "text".End position of the cutout.
Top is 0.

How to use

The slice function is used for text parameters.

In many cases, it is used to initialize or set variables of type "String".

Clicking on slice in the "Expression" tab sets the function name and () in the formula field.

If you see something like the following, your settings are complete.

You can change the contents of the function by clicking on the purple icon.

When dynamic content or variables are used in expressions, special specifications are required.

(How to get dynamic content with expressions.)

Examples of arguments and results

For example, slice('ABCDE',1,3) will result in "BC".

The last argument (length) may be omitted, in this case from the start position to the end.

slice('ABCDE',2) will result in "CDE".

For those who want to learn Power Automate Cloud flow effectively

The information on this site is now available in an easy-to-read e-book format.

Or Kindle Unlimited (unlimited reading).

You willl discover how to about basic operations.

By the end of this book, you will be equipped with the knowledge you need to use Power Automate Cloud flow to streamline your workflow.

Links

String Functions(Power Automate Cloud flows)