Skip to main content
All CollectionsBasics
Hidden Filters
Hidden Filters

Use hidden filters to segment your data with a single block!

Patrick avatar
Written by Patrick
Updated over 7 months ago

Overview

Contrary to a Visible Filter, a Frontly Hidden Filter on a data block is helpful because it allows the app builder to apply conditions or criteria to their data without showing these conditions to the user. This can be useful for several reasons:

Simplifies User View: Users see only the relevant data without being overwhelmed by complex filtering criteria. It keeps the interface clean and easy to understand.

Ensures Data Integrity: Hidden filters can enforce rules or constraints behind the scenes, ensuring that users only work with valid or appropriate data without needing to manually apply these rules.

Improves Performance: By filtering out unnecessary data before it reaches the user, hidden filters can improve the performance of the data table, making it faster to load and interact with.

Security and Privacy: Hidden filters can restrict access to sensitive data, showing users only the information they are authorized to see without revealing the existence of the filter itself.


Scenario

If you need to limit the data a user can see in your app based on who is logged in, you can create a Hidden Filter using custom user fields.

With this simple feature, you can build a dynamic application that shows different data to different users, while keeping all data in a single sheet.

Example: Filter By A Custom 'Team' Field

Your company has three distinct teams accessing the same page in your Frontly app, but you want them to only see the records that relate to their team.


Step 1. Create a Custom User Field called 'Team' on the Users page:


Step 2: Edit the Team field for a specific user

Next, click on a user and adjust the newly created 'Team' field, entering the desired value, which would be a 'Team' name in this case:


Step 3: Create a Hidden Filter

1. From your editing panel, click 'Filters' and you will see the 'Hidden Filter' option. Click 'Add Filter' and it will show the fields for you to set your conditions.


2. In this example, the 'Field' value will be the column that you've created to establish the differentiating data relationship between your defined teams.

3. You will want the 'Operator' here to be 'Equal' to the 'Value' you will establish, but there are many other operators to choose from depending on how you wish to apply the conditions for your hidden filters.

4. Lastly, for the 'Value' field, click the plus symbol on the right of the field to inject a dynamic variable for user Team. In this scenario, you will want to select the 'User' data source and select your custom 'Team' field.


Result

The {{user.Team}} variable in the value field tells the system to grab the Team value from the logged-in user when the app is running live.

This Hidden Filter will compare that value to the Team field in each row of the spreadsheet displayed in this block, and only display records that match.


Additional Features

Add Filters at the Data Source Level

In the Data Source settings, you can see a new 'Hidden Filters' section, allowing you to set filters that apply to your data source across ALL instances on all pages.

There are a few benefits of setting hidden filters this way:

Simpler setup: No need to duplicate hidden filters across your pages if the same rules apply, just add them at the data source level.

Security: Easier for you to ensure that the data access rules are applied in all pages without worrying that you missed something.

Note: These will be applied in addition to any block-level hidden filters.


Generate Filters with AI

If you're having a hard time articulating how to set up your hidden filters, try using the 'Generate with AI' feature to get AI to create them for you. Simply type in what you're hoping to achieve and check the results in the live preview after.


Condition Type

If you have multiple hidden filters set up, use this toggle to determine how these filters are applied with respect to one another. If 'All True' (AND logic) is toggled, all values must meet all the conditions in order for them to be displayed. If 'Any True' (OR logic) is toggled, values meet at least one of the conditions in order for them to be displayed.


Additional References

Click here to learn about all the Dynamic Variables
โ€‹Click here to learn about the Data Sources you can use inside your Hidden Filters

Did this answer your question?