I have rendered a SQL view in PowerApps in the form of a data table. The table itself, is pretty simple – four columns and multiple rows. The business problem I wanted to fix was as follows:
- I only want to show rows where a count of a field for a given row is equal to zero
- I want to filter the table using a toggle switch (the filter is on a “type” field that I have created)
- I want the entries to be displayed by the date field in descending order
The PowerApps code to achieve this is fairly simple, using the following. Once you have added your toggle switch(es), you want to set the data table items property like this:
Remember: you will need to change the names of the toggle switch, table/view and fields to match your naming convention)
When you Play the app and select the switch, it will show only the data that meets the criteria, in descending date order
You can add multiple If statements to this, but hopefully this is a simple example to get you started.