How to Filter Data table in Power Apps?

While working with a Power Apps requirement, I needed to filter a Power Apps Data table control based on various SharePoint columns. Also, it’s quite easy to achieve this.

In this Power Apps article, I will explain to you how to filter data table in Power Apps using various scenarios like:

  • Filter Power Apps Data table based on SharePoint Text column
  • Filter Power Apps Data table based on SharePoint Choice column
  • Filter Power Apps Data table based on SharePoint Multiple columns
  • Filter Power Apps Data table based on ComboBox control

How to Filter Data table in Power Apps

So, let’s proceed with this one by one.

Example-1: (Filter Power Apps Data table based on SharePoint Text Column)

We will discuss filtering Power Apps data table control based on a SharePoint Text field.

The data table will filter and display the specific item information whenever a user searches for any device name in the search box.

How to Filter Data table in Power Apps

To work around this, follow the steps below:

  • Below is a SharePoint list called Products. This list contains two columns:
    • Title = Single line of text
    • Vendor = Choice [APPLE, SAMSUNG, HP, DELL, LENOVO]
PowerApps data table filter
  • On the Power Apps screen, insert a Text input control where users can enter or search any Title like Mobile, Laptop, etc. Rename the text input control to txtSearchBox. Also, remove the text from its Default property.
  • Insert a Data table control and set its Items property as:
Items = Filter(
    Products,
    Title = txtSearchBox.Text
)

Where,

  1. Products = SharePoint List name
  2. Title = Specify the SharePoint field name the user will search in the text box
  3. txtSearchBox = Text input control name
PowerApps data table example
  • Now save and publish the app. Search any title value (like Mobile) in the text box; then, the specific item details will be displayed in the data table.

Example-2: (Filter Power Apps Data table based on SharePoint Choice Column)

Next, we will discuss filtering Power Apps data table control based on a SharePoint choice column.

  • As discussed in the SharePoint list [Products] above, there is a Vendor column with various choices, like APPLE, DELL, HP, LENOVO, etc.
Power Apps data table filter SharePoint choice field
  • The data table will filter and show the specific vendor details when a user chooses a name [suppose DELL] from the dropdown menu, as shown below.
Filter Power Apps Data table on SharePoint Choice field
Items = Choices(Products.Vendor)

Where,

Vendor = SharePoint Choice field

PowerApps data table filter SharePoint choice field
  • Next, add a Data table and apply the code below on its Items property as:
Items = Filter(
    Products,
    Dropdown1.SelectedText.Value in Vendor.Value
)

Where,

Dropdown1 = Dropdown control name

filter Power Apps data table
  • Save, publish, and preview the app. The vendor information will be filtered and displayed in the data table once you select a name from the dropdown menu.

Example-3: (Filter Power Apps Data table based on SharePoint Multiple Columns)

We can filter the Power Apps Data table control using multiple SharePoint columns [with different data types]. To do so, check this scenario below:

  • There is a SharePoint list named TSInfo Attachments. This list has these many columns below with various data types:
ColumnData type
TitleSingle line of text
Attachment TypesChoice [PPT, PDF, Excel, Microsoft Document]
Attachment CostsCurrency
Attachment Created DateDate and time
Filter PowerApps Data table with SharePoint Multiple Columns
  • In Power Apps, there is a Text input and Data table control. A user will search for any text/item (from the Sharepoint list) in the search box; then the data table will filter accordingly.
Filter Power Apps Data table based on SharePoint Multiple Column
  • To achieve this, add a Data table control and set its Items property as:
Items = Search(
    AddColumns(
        'TSInfo Attachments',
        "AttachmentCreated",
        Text(
            'Attachment Created Date',
            DateTimeFormat.ShortDate
        ),
        "AttachmentType",
        'Attachment Types'.Value,
        "Attachment Cost",
        Text('Attachment Costs')
    ),
    txtSearchBox.Text,
    "Title",
    "AttachmentType",
    "Attachment Cost",
    "AttachmentCreated"
)

Where,

  1. “AttachmentCreated”, “AttachmentType”, “Attachment Cost” = New Column Names
  2. ‘Attachment Created Date’ = SharePoint Date column
  3. ‘Attachment Types’ = SharePoint Choice column
  4. ‘Attachment Costs’ = SharePoint Currency column
Filter Power Apps Data table with SharePoint Columns

This way, we can filter the Power Apps Data table control with SharePoint multiple columns.

Example-4: (Filter Power Apps Data table based on ComboBox Control)

This example will discuss filtering Power Apps Data table control based on a Combo box control.

  • The image below shows a Power Apps Combo box control with some items. A user can filter and view specific selected item details in the data table by selecting multiple items from the combo box.
Filter Power Apps Data table based on ComboBox control

For this example, I have taken the above SharePoint list named Products.

  • On the Power Apps screen, add a Combo box control and set its Items property as: [Make sure its Multiselect option should be enabled]
Items = Products.Title

Where,

Title = Specify the SharePoint column name the user selects from the combo box.

powerapps data table filter sharepoint column
  • Next, Insert a Data table and apply the below formula on its Items property:
Items = Filter(
    Products,
    Title in ComboBox1.SelectedItems
)

Where,

ComboBox1 = Combo box control name

power apps data table filter sharepoint column
  • Save, publish, and preview the app. Once you select one or more items in the combo box, the data table control will display the filtered result.

Conclusion

Now I hope you got some clarity on how to filter a Power Apps Data table control based on various scenarios like:

  • How to filter Power Apps Data table based on SharePoint Text field
  • Filtering Power Apps Data table based on SharePoint Choice field
  • Filter Power Apps Data table based on SharePoint multiple columns
  • Power Apps filter Data table based on ComboBox control

Also, you may like some more Power Apps tutorials:

>