We use cookies to improve our service. Learn more.

Guides / Intermediate Concepts

Conditions, Filtering, and Visibility

Limit the content that is displayed in your projects

Filtering & Visibility conditions are NOT security features. When you hide tabs, components, or filter out items in lists, the data is still accessible on your device. To learn how to protect sensitive data, read our Security Guide

Introduction

Conditions appear in many places in Glide and are used in different ways. You can use Conditions to filter lists, control the visibility of components, create actions that only run when a condition is met, and much more. For example, you could;

  • Show all the items with status marked as completed
  • Hide a component if the user is not an admin
  • Show a tab only if the user has submitted this form
  • Show the add button only if a user has writing priveledges
  • Let users edit their own profiles, but not other users’ profiles

A quick example of creating a condition

Below is a condition on the Edit Screen in Apps that prevents anyone who is not an admin from editing items.

Configuring the Edit Screen
Configuring the Edit Screen

The way you can create this is as follows:

Step 1:

Select a column value from your data as the thing that will be tested against the condition. In this example, we’ve selected the User Profile Role column.

Step 2:

Choose the condition type or ‘operator’. In this example, we have chosen Is.

Step 3:

Finally, pick the value that your condition will be testing for. In this example, the condition will check if this value matches the first value we added — because we used the operator Is.

This example uses a Custom Value that we add manually in Glide. If you click the dropdown menu, you can also select column values.

To get a quick overview of conditions, you can watch this video. Or, if you want to dive in and really master all there is to learn — read the rest of this article below.

What values do I have access to in conditions?

Current Row

Depending on the screen you’re currently viewing, you’ll have access to the data for the current row.

User Profile

If you’ve configured a User Profile table for your project, the data related to the currently logged in user is available to use for conditions. For example, you can filter a list so that it only displays information that is relevant to the logged in user based on a column in their user profile.

Containing Screen Context

When you are creating conditions, you may see another category called 'Screen'.

This lets you choose values from the current screen – enabling you to do things like:

  • Show items where Category is the same as Category (to show a list of items that relate to this one)
  • Show items where Price is equal to Price (to show a list of items which have the same price as the current item)

We’ll show some more examples of this in the Advanced Conditions section below.

Filtering

By default, lists & collections show all the rows coming from your data source. However, you can filter the rows that appear in your list. You can also enable in-app filtering so that users can change the filtering themselves.

Filtering a list or collection

To filter items out of a list or collection, visit the component’s options panel.

To set a filter, click Add Filter. A new filter will be added by default.

The top dropdown shows all the columns in the table that your list is connected to. For example, our list shows products and so the columns we see are all the columns in our Products table.

Filtering will not be able to see items that you filter out of a list. For example, in the app below we add a filter that shows only the employees where the Is Manager column contains 'Yes'.

The filter is created by checking certain criteria on a column in your sheet. In the example below, we have a list of employees. Some are managers, some are not. We have a column in our sheet that identifies Top Managers and then values in that column of Yes and No.

In Glide, we select that column as the Filter column and then choose the criteria by which we are filtering.

We use the same sheet as a source in multiple tabs and then filter each one in different ways. For example, the app below shows the same staff list in three different tabs. Each tab has the same exact source sheet, but each one is filtered to show only those with a different diet.

Multiple filters

We can use multiple filters on a list with AND + OR logic. In the following example, we add two filters to our list of cookies to show only items that include 'coconut' or 'coffee' in the Name column.

In-app filtering

You can also enable in-app filtering for your users so they can change the items that are displayed in the list. This is particularly useful for long lists of items. In the example below, we enable in-app filter based on the Size column which allows users to see only the drinks with certain sizes.

Visibility

Tab Visibility

You can hide and show different tabs based on User Profile data. For example, if you have a look at this app below, you'll see 3 tabs.

However, to allow administrators to process these feature requests we have two other tabs that have visibility conditions set on them. These tabs only show when the logged-in user's Admin property is TRUE.

You can add conditions in the Options section of each tab 👇

Component Visibility

Component visibility allows you to hide or show components based on certain conditions. In the app below we have set numerous component visibility rules that make our party invitation dynamic, depending on the RSVP of the user.

To set a condition on a component's visibility, head to the Options tab in the component's settings. There you will be able to add a condition based on the data in your sheet. Once you add this condition, the component may disappear from the app's screen, but you can still access it on the right-hand side of Glide.

On the first screen of our form below we can initially see two text entry components and one choice component. However, on the right-hand side image, we can see all our hidden components are visible when their conditions are met.

In Pages, you can use Containers to control the visibility of multiple components at the same time. Learn more here (link to Containers documentation, which should include visibility language).

Conditional add, edit & delete

Allowing users to add, edit & delete records can be very powerful, but you’ll almost certainly want to restrict this to only certain items or to certain users.

In Pages, this is a lot more complex, but we will be making it a lot easier in the future. For now, check out our guide on Filtering & Visibility conditions to learn more.

Conditional adding

To set conditions on whether people can add items to a list, go to the configuration panel of your list and enable the Add Screen.

You could set conditions like:

  • Only allow adding items if the total number of items is below 100
  • Only allow a user to add items if they are an Admin
  • Only allow users to add items if they have completed their user profile

Conditional editing

To set conditions on whether people can edit items in your lists, go to the details screen for an item and enable the Edit Screen. This condition will be set on all items in that list.

Conditional Delete

You can also set conditions for deleting items, the same way you set conditions for editing items.

Updated 5 days ago
Previous
Actions
Was this helpful?