(Deprecated) Budibase Docs
  • đź‘‹Introduction
  • Quickstart tutorials
    • Build a CRUD app
      • Importing the Vehicles table from a CSV
      • Creating the Service log table from scratch
      • Listing recent Service Logs on the home screen
      • Creating a new Service Log with a modal
    • Build a CRUD app- SQL
      • Connecting to your SQL tables
      • Creating Screens from your SQL tables
      • Using relationships between SQL tables
      • Creating a List screen from scratch, using a SQL table
      • Creating a new log, with a modal
    • Build a CRUD app - REST
      • Adding a REST datasource
      • Creating a query that Lists Issues
      • Using your request to display items in your app
      • Add a “Create Item” request
      • Create a new todo Item, inline
      • Mark todo items as “Done”
      • Finishing Touches
  • Building apps
    • Data
      • Users table
      • Data sources
        • Internal/CSV
        • PostgreSQL and MySQL
        • REST
          • REST Queries
          • REST Bindings Example
          • REST Query Import
          • REST Authentication
          • REST Variables
        • Other sources
      • Data Types
        • Text
        • Number
        • True/False (Boolean)
        • Date/time
        • Options
        • Attachments
          • Example
        • Relationships
          • Example
        • Formula
        • JSON
      • Views
        • Filters
        • Calculations
        • Groups
      • Transformers
    • Design
      • Screens
      • Layouts
      • Components
        • Section
        • Container
        • Data Provider
        • Repeater
        • Table
        • Chart
        • Card
        • Text
        • Button
        • Link
        • Icon
        • Image
        • Embed
      • Forms
        • Form Component
        • Field Groups
        • Fields
      • Bindings
      • Actions
      • App State
      • Conditions
      • App theming (coming soon)
      • Handling Data
        • Search/Filter Data
    • Automate
      • Automation steps
        • Triggers
        • Logic
        • Actions
      • Activating and testing
      • Contextual bindings
    • Admin and management
      • User Management
      • Authentication and SSO
        • OpenID Connect
        • SSO with Auth0
        • SSO with Azure AD
        • SSO with Okta
        • SSO with OneLogin
        • SSO with Google
        • SSO with Keycloak
      • Email
      • Portal
      • User Settings
  • Guides
    • Display user-related data
    • Add search
    • Add filtering
    • Create public & private screens
    • Writing a custom SQL query
    • Create a child record from the parent
    • Items assigned to me
    • Master-detail
  • Self-hosting
    • Get started
      • Budibase CLI Setup
    • Hosting methods
      • Overview
      • DigitalOcean
      • Kubernetes (K8S)
      • Docker compose
    • Hosting settings
      • Advanced options
        • Reverse proxy
    • Accessing CouchDB
    • Accessing MinIO
  • References
    • Budibase architecture
    • Deployment information
    • Troubleshooting
    • Contributing to Budibase
      • Writing Your Own External Data Connectors
Powered by GitBook
On this page
  • Adding a condition
  • An example
Export as PDF
  1. Building apps
  2. Design

Conditions

Budibase lets you conditionally show, hide or update component settings

PreviousApp StateNextApp theming (coming soon)

Last updated 3 years ago

A lot of the time you want to change the state of some component when certain conditions are true or false. This might be changing a color from red to green, showing or hiding a component. You will find the condition settings at the very bottom of the settings panel of your components.

Adding a condition is simple. Once you click the settings button a drawer will pop up and you will be able to add, edit or remove your conditions. It will look something like this

Adding a condition

To add a condition, simply click the Add condition button. As explained above, you can choose wether to Show, Hide or Update setting. Depending on what you choose you will be presented with different options. They will all contain settings for comparing some value against another.

An example

In the example we're going to discuss we have a simple backend table that contains three records. It looks like this:

As we can see, there are four fields, Company, Due Data, Value and Paid. In the Design section we have designed a simple interface showing each of our invoices in rows. It looks like so:

It would be great if the Pay Invoice button was in a disabled state if the invoice has been paid. So let's go ahead and add a condition to do just that!

Select the button component in the tree view on the left. Open the conditions drawer and select Update setting and then pick the Disabled setting in the dropdown. Make sure the checkbox is checked. We then need to figure out which field we want to check. In our case it's found under {{ Repeater.Invoices.Paid }}. This will of course differ depending on the structure of your application. If you click the little lightning bolt icon you will be able to see which fields are available for use. Now we just make sure that it equals TRUE. Hit save, and that's it!

Now that we have this condition set up we might also want to change the text of the button to say "PAID". To do that, simply click the copy button and change the setting to "text". Change the text to "PAID" and hit save.

And here's the end result.

An empty condition drawer
The different parts of the condition settings
Example table data
Design of the list of invoices