'Canvas app with SharePoint Data Source - Filter gallery on multi choice combobox

I have created a canvas app with SharePoint as data source. This is just a test list that I have created: SharePoint List

In the list I have two columns - Title and Choice Column (This column is a multi choice column in SharePoint).

In my application I have created a gallery to display the records that I have created and one combo box field, which is taking the choices for the column in SharePoint: Canvas Application

I have created the following filter for my gallery, so I can filter the gallery based on my combo box selection:

Filter('Test List', IsBlank(ComboBox1.SelectedItems)|| IsEmpty(ComboBox1.SelectedItems)|| ComboBox1.Selected.Value in 'Choice Column'.Value)

The filter is working correctly, if you choose only one value from the combo box field: Filtered Gallery

The combo box items are displayed as follows: Choices('Test List'.'Choice Column')

I would like to filter the gallery as follows: If I choose "Choice 1", I would like to see all of the items where I have "Choice 1" selected. If I choose "Choice 1" and "Choice 2", I would like to see the records where I have "Choice 1" or "Choice 2" or both.

At the moment, when you select only "Choice 1", the filter is working. When you add "Choice 2", it is showing only the results, where I have "Choice 2".

I have tried many things like: Filter('Test List', IsBlank(ComboBox1.SelectedItems)|| IsEmpty(ComboBox1.SelectedItems)|| Concat(ComboBox1.SelectedItems.Value, Value & " ") in Concat('Choice Column'.Value, Value & " "))

But this is not helping me, since it will look for an exact match: for example: If I choose "Choice 1" and "Choice 2", it will return the records where I have exactly "Choice 1", followed by "Choice 2": Filter results

I have tried using the following filter as well: ForAll(ComboBox1.SelectedItems.Value, Filter('Test List', Value in 'Choice Column'.Value))

But this is breaking the Gallery: Gallery errors

In addition, I have tried the following: Filter('Test List', IsBlank(ComboBox1.SelectedItems)|| IsEmpty(ComboBox1.SelectedItems)|| ComboBox1.SelectedItems in 'Choice Column')

But it is resulting in an error: Error in Filter

Does somebody have an idea how the gallery can be filtered on multi choice field in SharePoint? Thank you in advance!



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source