Filter options
So, you've included your own data into your app using either the Excel or Web Service building block. However the amount of data being presented to the user is might be too large large and you would like to filter the list.
In this short how-to article we will walk you through the few simple steps you have to complete in order to filter your list with the “Filter Expression” which you can find in the Advanced Tab of your Web Service or Excel block.
Options
Operand | Name |
>= | Greater Or Equals |
<= | Smaller Or Equals |
= | Equals |
!= | Not Equals |
% | Contains |
> | Greater |
< | Smaller |
AND | condition 1 AND condition 2 have to be true |
OR | condition 1 OR condition 2 have to be true |
{AM:NOW} | show items that are on the current device date (date ="{AM:NOW}") |
am_distance | Show items based on a user location in meters |
We’ve added two screenshots with every filter. First one is the list without the filter and the second is the list after applying our filter. Let’s go!We have taken the demo app “Movies” to demonstrate the filter possibilities.
You can filter the data for example by using the statement ‘City = London’.
- Remember that you can only apply filters on “fields” of your Web Service or Excel.
- You can “combine” as many filters as you like in one expression
1. GreaterOrEqual >=
Filter | Description |
vote_average >= '7' | Shows all movies with an vote_average of 7 or higher. Ant-Man and Magic Mike XXL are being filter from the list. |
2. SmallerOrEqual >=
Filter | Description |
vote_average <= '7' | Shows all movies with an vote_average of 7 or lower. Ted 2 and Inside out are being filter from the list. |
3. Equals =
Filter | Description |
title = Minions | Shows the movie with the title ‘Minions’ |
4. NotEquals !=
Filter | Description |
release_date != '2016-05-27' | Shows the movies when the release_date is not “2016-05-27”. In this case. X-Men: Apocalypse is being filtered from the list. |
5. Contains %
Filter | Description |
title % ‘The’ | Shows the movies when the title contains the word “The” |
6. Greater >
Filter | Description |
vote_count > 500 | Shows the movies when the vote_count is higher than 500 votes. |
7. Smaller <
Filter | Description |
vote_count < 200 | Shows the movies when the vote_count is lower than 200 votes. |
8. COMBO AND - Contains % AND EqualsOrHigher >=
Filter | Description |
release_date % "1985" AND vote_average >= "6" | Shows the movies when the release_date contains 1985 AND the vote_average equals 6 or higher. Star Wars & Mad Max are being filtered from the list. |
9. COMBO OR - Contains % OR EqualsOrHigher >=
Filter | Description |
release_date % "1985" OR vote_average >= "7" | Shows the movies when the release_date contains 1985 OR the vote_average equals 7 or higher. The terminator & Ghostbusters are being filtered from the list. |