複数選択可能なコンボボックスでギャラリーをフィルターする方法を聞かれたので、メモ。
事前準備


※未選択時は全アイテム表示

委任がきいている場合→「ddd」「eee」のアイテムがフィルター後も表示される

SharePointリストの場合

※下図の例だと先頭3個まではフィルタ可能

Filter(SampleList As item,
IsBlank(ComboBox1.SelectedItems) || IsEmpty(ComboBox1.SelectedItems) ||
(CountRows(ComboBox1.SelectedItems) > 0 && item.Title = Index(ComboBox1.SelectedItems,1).Value) ||
(CountRows(ComboBox1.SelectedItems) > 1 && item.Title = Index(ComboBox1.SelectedItems,2).Value) ||
(CountRows(ComboBox1.SelectedItems) > 2 && item.Title = Index(ComboBox1.SelectedItems,3).Value)
)
これは、SelectedItemsが0個とかのときにIndex関数でアイテムにアクセスして内部でエラーが発生しているため(だと思われる)。

Dataverseの場合

Filter(SampleTable,
IsBlank(ComboBox1_1.SelectedItems) || IsEmpty(ComboBox1_1.SelectedItems) ||
Name in ComboBox1_1.SelectedItems.タイトル
)
やっぱりDataverseはとても楽。
おまけ:コンボボックスの選択肢がマスタテーブルを参照する場合








コメント