intersection function. Collection.(Power Automate Cloud flows)
Function to create a new array with the common items of two arrays.
Spec
intersection(<collection1>,<collection2>)
Argument | Default | Description |
---|---|---|
collection1,2 | Required field | Target arrays. |
How to use
In many cases, it is used to initialize or set variables of type "Array".
Clicking on intersection in the "Expression" tab sets the function name and () in the formula field.
The argument is two arrays.
When dynamic content or variables are used in expressions, special specifications are required.
(How to get dynamic content with expressions.)
If you see something like the following, the setup is complete.
You can change the contents of the function by clicking on the purple icon.
This time, as an example, we have two array variables. [100,300,400] and [100,200,300,500].
Execute the following expression "intersection(variables('ary1'),variables('ary2'))"
The common items, 100 and 300, are extracted into an array.
Usage Example. Determining if there is a common item.
When combined with Condition and length, it can be used to determine if there is a common item.
Left | length(intersection(variables('ary1'),variables('ary2'))) |
Center | is greater than |
Rigth | 0 |
The results are as follows.
If yes | Common items exist. |
If no | No common item exists. |
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!