Showing Data in app - Filtres
You can filter any app user data or actions they perform within your app. Once Filter is created it is updated automatically every 10 minutes OR as soon as the data pull request was sent to.
Filters output the following data:
- Aggregated data (record count, max, min value)
- List of records which fall under Filter condition
CREATE YOUR FIRST FILTER
- Open Demo App
- Create new screen by clicking Add Screen at the bottom of the screen
- Go to Objects in the top menu
- Click Add Filter and then Create Filter
- Name the filter as AgeEmail
- In Conditions section select Email as the searchable field from the first drop down
- Select Contains and enter gmail, click on highlighted option when done
- Click Save Changes at the bottom of the screen.
DISPLAY FILTER RESULTS ON APP SCREEN
Now modify the logic of the created filter to show how many gmail users are less than specific age entered into another field.
- Go to Constructor - click Application on the top and then Constructor
- Drag and drop Text Input element to the screen emulator
- Set Text Input properties:
- Backendname as Age
- Default Value as #Variable:ageVar#
- Drag and drop Button element
- Set Caption Button property to Check Age #Backendname:Age#
- Click Actions, open Add new action drop down, select Set Variable
- Set variables properties as:
- Name: ageVar
- Value: #Backendname:Age#
- Click Save
- Click Save Screen
- Go to Objects section, click on your AgeEmail filter and choose Edit in the pop up menu
- Click Plus sign to add another condition - keep the logical condition to be AND
- In the first dropdown select Age column, change column type to numeric
- Set the comparison condition to be less than #Variable:ageVar#
- Click Save changes
- Go back to Constructor and add Text element to the screen emulator (this element will show the result of filter count)
- Fill in Text properties with - Number people with age below #Variable:age#: #ObjectsFilter:AgeEmail:Count#
- Click Save Screen.
CHECK YOUR WORK
Click Preview to launch the app from the current screen to check it works.
We use Hashtags functionality to reference Objects filter AgeEmail and call it's count - the number of records which fall under filter condition.