---
description: Smart Filters
---

# Filter any backend and Object data

Process and filter data, stored on the platform, to make it available anywhere via [hashtags](hashtags) mechanism.

\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_

#### FILTERS' USAGE

| **Data sets that can be filtered**                                                              | **How to refer to filtered results**              | **Where to reference Filtered data**                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| ----------------------------------------------------------------------------------------------- | ------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| <p></p><ul><li><a href="objects">Objects</a> data</li><li><a href="events">Events</a></li></ul> | <ul><li><a href="hashtags">Hashtags</a></li></ul> | <p></p><ul><li>in <a href="https://app.gitbook.com/article/l6t1xqhokp-constructor">Constructor</a> HTML Elements</li><li>in <a href="https://app.gitbook.com/article/9cncrxycvp-events">Events</a> creation hashtag as value</li><li>To define <a href="https://app.gitbook.com/article/uxp0kjy3sq-hide-show-screen-elements">elements visibility logic</a></li><li><a href="https://mobsted.helpdocs.io/app/content/article/cv0t24tdm6">Loops</a></li><li>Operations</li></ul> |

Find filters in **Constructor** → **Backend** or **Constructor** → **Objects:**

![How Filters are displayed in Mobsted PWA multichannel platform from Events tab](https://storage.googleapis.com/helpdocs-assets/jyme83anlw/articles/1iu48fq9db/1553766836055/filter-look-new.gif)

\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_

#### CREATE FILTER

1. Go to **Filters:** **Backend** or **Constructor** → **Objects**
2. Create new **Filter:** click **ADD FILTER** in the top left corner, then click **Create New Filter.**

![How to create Filter on Mobsted PWA platform](https://storage.googleapis.com/helpdocs-assets/jyme83anlw/articles/gzp3oanbxi/1538996388228/untitled.gif)

\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_

#### SET FILTERS' CONDITIONS

1. Select the value to be compared. Possible options:
   * Action name of the Event
   * Key of the [Event](https://kb.mobsted.com/article/9cncrxycvp-events)
   * Object property, such as: Phone, Email, Login date.
2. Select the comparison criteria. Possible options:
   * Equal ( = ) - strict match.
   * Not equal ( <> )
   * Contains
   * Doesn't contain
   * Is Set - checks if the field specified is NOT empty
   * Is Not Set - checks if the field specified is empty
3. Select the comparison value. Possible options:
   * String from the dropdown
   * Any text typed in manually

![Condition filter set up on Mobsted Multichannel PWA platform](https://storage.googleapis.com/helpdocs-assets/jyme83anlw/articles/1iu48fq9db/1554112655910/image.png)

\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_

#### CREATE EVENT/OBJECT FILTER

Each **Filter** works with **Events** and **Objects** simultaneously. **For example:** if the filter counts **how many clicks** were made on the particular button in **Events,** the same filter will show **how many people** clicked the button in **Objects** section.

1. Set up for **Object** filter that calculates the average age of people with mobsted.com email:

![Object filter set up on Mobsted Multichannel PWA platform](https://storage.googleapis.com/helpdocs-assets/jyme83anlw/articles/1iu48fq9db/1554112588923/image.png)



&#x20;2\. Set up for **Event** filter that calculates the number of clicks on the button with the BackendName "updatePhone" within last 7 days:

![Event filter set up on Mobsted PWA multichannel platform](https://storage.googleapis.com/helpdocs-assets/jyme83anlw/articles/1iu48fq9db/1553845971421/image.png)

\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_

#### MERGE TWO FILTERS

Filter can contain either AND or OR condition. In order to have OR + AND conditions use [hashtags](hashtags) within new filter.

**Example**: we created the filter that will display everyone with email on Mobsted **OR** Outlook domain, **and** who has US phone number.

![Logic of filter functionality on Mobsted PWA platform](https://storage.googleapis.com/helpdocs-assets/jyme83anlw/articles/1iu48fq9db/1554116397746/image.png)

1. First filter will contain the required Email condition, we will name it as **Email**.

![Simple filter created on Mobsted PWA platoform](https://storage.googleapis.com/helpdocs-assets/jyme83anlw/articles/1iu48fq9db/1554105265429/image.png)

2\. Second filter will contain the required phone condition merged (AND operator) with the **Email** filter above.

![Filter with nested Filter in it created on Mobsted PWA platform](https://storage.googleapis.com/helpdocs-assets/jyme83anlw/articles/1iu48fq9db/1554106194097/image.png)

\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_

#### USE AGGREGATE FUNCTIONS

Aggregation methods applicable for filter:

* SUM
* AVG
* MIN
* MAX
* COUNT

![Example of using aggregation on Mobsted multichannel PWA making platform ](https://storage.googleapis.com/helpdocs-assets/jyme83anlw/articles/1iu48fq9db/1553856460857/image.png)

\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_

#### USE PERIOD SETTING

Set up a time period the filter will be applied on. Time period can be fixed between dates specified, or dynamic - older than 2 days / younger than 3 weeks. Can be used with OR or AND conditions, but not combined.![The example of setting up fixed on dynamic time period in Filters on Mobsted multichannel PWA making platform](https://storage.googleapis.com/helpdocs-assets/jyme83anlw/articles/1iu48fq9db/1553859273567/image.png)

\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_

#### PREVIEW YOUR FILTER RESULTS

Click on the filter to see all the data applicable to it. To see all the data click again on the filter to unselect it.![Example of how to preview Filter results in Filters on Mobsted multichannel PWA making platform](https://storage.googleapis.com/helpdocs-assets/jyme83anlw/articles/1iu48fq9db/1553859598452/ezgif-com-video-to-gif-3.gif)

\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_

#### SHOW / HIDE THE SAME FILTER FROM OBJECTS / EVENTS

To hide / show the same filter in **Objects** and **Backend** section click **ADD FILTER** and select checkbox for the corresponding column.![Demonstrares how to hide and show filters for Events and Objects on Mobsted multichannel PWA platform](https://storage.googleapis.com/helpdocs-assets/jyme83anlw/articles/1iu48fq9db/1553846825754/screen-shot-2019-03-29-at-1-06-22-pm.png)

\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_

#### SHOW FILTER RESULTS ON APP SCREEN

It is possible to display filter results to app user by using [Hashtags](https://kb.mobsted.com/article/9v4k7sfkq1-hastags).

1. Showing filter counts:\
   We use [Hashtags](https://kb.mobsted.com/article/9v4k7sfkq1-hastags) to refer to Object's filer "Age" and show the Count of matching records.\
   &#xNAN;**#ObjectsFilter:Age:Count#.**![](https://storage.googleapis.com/helpdocs-assets/jyme83anlw/articles/l0x27jbs28/1557278691532/image.png)

**Note**: for more detailed information on the set up, please, check [**Use automatic data filters**](https://kb.mobsted.com/article/l0x27jbs28-use-filters-and-display-results-data-on-an-app-screen) article. You can also check how it is set up in **Demo App** in your acсount, screen - **8 Filters Count**.

1. Iterating through filter records:\
   We use [Hashtags](https://kb.mobsted.com/article/9v4k7sfkq1-hastags) functionality combined with loops to go through each record. How to set it up:
   1. Enable loop on the element you want to iterate
   2. Use your filter data as data source. In our case it is **#ObjectsFilter:AgeEmail:Data#**
   3. Name the loop. In our case it is **AgeEmailLoop**
   4. Reference the loop and call the properties of the Object that you want to display, in our case it is **Name ( #Loop:AgeEmailLoop:objects@Name# )** and **Age ( #Loop:AgeEmailLoop:objects@Age#).**![](https://storage.googleapis.com/helpdocs-assets/jyme83anlw/articles/1iu48fq9db/1557279702095/screen-shot-2019-05-08-at-6-36-41-am.png)Mobile View:![](https://storage.googleapis.com/helpdocs-assets/jyme83anlw/articles/1iu48fq9db/1557279908164/image.png)



{% hint style="info" %}
**Note:** for more detailed information on the set up, please, check [Apply loops to screen elements](https://kb.mobsted.com/article/cv0t24tdm6-use-filters-and-display-multiple-line-results-in-app) article. You can also check how it is set up in **Demo App** in your account, screen - **9 Filters Iterate.**
{% endhint %}

####

#### MENTIONED ARTICLES

* [Hashtags](https://kb.mobsted.com/article/9v4k7sfkq1-hastags)
* [Events](https://kb.mobsted.com/article/9cncrxycvp-events)
* [Objects](https://kb.mobsted.com/article/sf7369s2zb-manage-app-users-objects)
* [Use automatic data filters](https://kb.mobsted.com/article/l0x27jbs28-use-filters-and-display-results-data-on-an-app-screen)
* [Apply loops to screen elements](https://kb.mobsted.com/article/cv0t24tdm6-use-filters-and-display-multiple-line-results-in-app)

####

#### RECOMMENDED ARTICLES

* [Referencing filter data](https://kb.mobsted.com/article/efmhc4fpam-referencing-filter-data)
