slice function.(Power Automate Cloud flows)
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>)
Argument | Default | Description |
---|---|---|
text | Required field | Source text of the cutout. |
startIndex | Required field | The starting position of the cutout. Top is 0. |
endIndex | From "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.
Discussion
New Comments
No comments yet. Be the first one!