openBuild
  • Introduction
    • Introduction
    • The Framework
    • The Library
    • Release Notes
  • Core Concepts
    • Bubble vs openBuild
    • Responsive Design
      • Repeating groups
      • Advanced Responsiveness
    • Styles
      • Typography
      • Colors
      • Groups & Box Shadow
      • Inputs
      • Buttons
      • Style Variations
      • Changing styles
      • Custom CSS
    • Pages
      • index
      • base-menu
      • base-top
      • base-ribbon
      • base-mobile
      • admin
      • verify
      • styleguide
      • terms
      • login
      • reset_pw
      • privacy
      • 404
      • Menu
      • Base Layouts
  • WORKING WITH the framework
    • Getting Started
    • Navigation
      • Go to page
      • Navigation through custom states
      • Navigation through URL parameters
      • Navigation through URL parameters with Option sets
    • Data & Workflows
      • Custom States
      • Custom Events
      • Working with Reusables
      • CRUD
      • Source Popup
      • Backend Workflows
    • Users and Roles
    • Signup, Login, Password reset
    • Security & Privacy
      • Authenticating endpoints
    • Transactional Email
      • Setup Sendgrid
      • Setup Postmark
    • Alerts and Confirmations
    • Customization
    • Best Practices
      • Syntax
      • Color Coding
  • openBuild Library
    • Chrome Extension
  • Framework Elements
    • Menus
    • Option sets
    • Plugins
    • API Connector
    • User Access Management
    • CRUD Floating Group
    • CRUD Popup
    • Data Table
    • Security Redirect
    • Mail management
    • User Settings
    • Header & Footer
Powered by GitBook
On this page
  • Storing data on your page temporarily
  • Working with pre-loaded data
  1. WORKING WITH the framework
  2. Data & Workflows

Custom States

PreviousData & WorkflowsNextCustom Events

Last updated 2 years ago

A custom state is an arbitrary container capable of holding any type of data (single or list) that is readily available to the user in the current browser session.

It doesn't matter where you create the custom state (or how), as long as you keep in mind that when you add it inside a cell of a repeating group or inside a reusable element, you cannot access it through a normal 'set state' action.

Custom states have two major use cases:

  • Storing temporary data on the page

  • Navigation

Remember Custom states will not store the data you have saved if you reload the page.

Storing data on your page temporarily

In the example below, based on the pre-build admin page that you will find in the template, we want to select multiple users in a list and perform a bulk action on those selected users.

When the user clicks the checkbox for selecting a user in the table, we add this user to our custom state list of users which we created previously.

We can then send the list of users from the ⚡️selectedUsers to the backend workflows to delete them.

Make sure that the custom state is of the type you want to work with and the 'is a list' checkbox is checked.

Working with pre-loaded data

If you work with set of data that has be pre-loaded on a page it's better to use Repeating Group element rather than a custom state as a list.

For example imaging we have a field called ' Permissions' on the User data type. If you would like to display list of Permission on page load for that User via state would have to set that values on the page load since you cannot set default values of a state if it's a list or custom datatype.

If you have more then one custom state list or custom state field where data needs to always be available on page load, the 'Page is loaded' can quickly become bulky with 'Set state' action, especially if you have multiple elements where you want to set the state.

Additionally manipulating the list in the Repeating group is as easy as manipulating the custom state with the 'Display list in a repeating group' action.

It's much better to work with repeating groups when it comes to lists. On the page load, you do not have to worry about setting the state of the list as it will automatically pre-populate since it's a repeating group. You can structure your repeating groups in the or use the Repeating group in which you display the data.

Source popup
We selected 3 users from the table. All of them are added to the Custom state list.
Using list & states in action
Setting default state on page load
Repeating group storing permissions of the User