PowerApps and SharePoint – Filtering the List View

*Disclaimer* – This post based on Preview version of PowerApps. I’ll make every effort to update with any changes and verify when PowerApps is released. 

One of the powerful features in PowerApps for SharePoint users is the ability to create an app from a SharePoint list. When using this feature, PowerApps creates three screens for us to start with: A Browse screen, a View screen, and a New/Edit Item screen.  

The Browse screen contains a Gallery control – which displays the contents of a list. By default it shows ALL items in a list. This might be fine for some business needs – especially with the inclusion of the search functionality also built into the default screen. Some use cases however may look for a filtered view of a list. 

The Short Version

The browse screen is set up to show all items, as well as take input from the search box. I’m going to change the list to display all items where the Request Type is a certain value.

  1. Select the Gallery on the browse page 
    image
  2. Change the Items formula from search-based to filter-based:
    From:
    image
    SortByColumns(Search(‘Service Requests‘, TextSearchBox1_1.Text, “Comments”, “Notes”, “Title”, “Title”), “Comments”, If(SortDescending1, Descending, Ascending))
    To:
    SortByColumns(Filter(‘Service Requests’, ReqType.Value=”PEBKaC”), “Comments”, If(SortDescending1, Descending, Ascending))
  3. Items displayed on the screen should now be filtered by the Request Type.

Notes

  • Similar to other methods in SharePoint (like CSR with JSLink) the field names seem to be using the internal name of the field. Above, when accessing the Request Type we needed to use ‘ReqType’.

References

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.