0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

PowerAutomateでUNION、そしてEXCEPT

Posted at

皆さんPowerAutomateでいろいろワークフローを作成しているなかで、「なぜ PowerAutomate では union() 関数が使えるのに except() 関数が使えないのだろう?」と考えたことはないでしょうか?
私はあります。
そして「なぜ」は未だにわかりません。
それはそれとして・・・

Problem

PowerAutomateでは、配列Aに配列Bの要素を加えた配列Cを作るのに union()関数を利用できる(ただし unionAll() ではなくunion() なので、ユニークな要素の一覧になる)。
一方で、配列Aから配列Bの要素を除いた配列Cを作るのに 適当な関数は存在しない。

Solution

存在しないものは仕方がないので、あとはどれだけシンプルに高速なフローを実現するか。
ループ(Apply to each)を使用するのは「シンプル」でも「高速」でもないので却下。
代わりに「アレイのフィルター処理」アクションを使用する:

image.png

  • 「差出人」(from)には 配列A を指定
  • 条件式の左辺には 配列B を指定
  • 条件式の演算子には 「次の値を含まない」を指定
  • 条件式の右辺には 配列Aの要素、つまり item() を指定

配列Aに配列Bの要素を加えた配列Cを作るのであれば union(arrayA, arrayB) でこと足り、アクション(ステップ)を利用するまでもないのですが、配列Aから配列Bの要素を除いた配列Cを作ろうとするとそうは行きません。
残念です。。。

0
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?