Ask AI
Skip to main content

Create a boolean

Function: Create a boolean

This action allows you to create a new True/False variable and store it for use in other parts of your application. The platform will automatically assign a name to this new variable, making it available for use in subsequent actions or logic.

Input

  • Value: Choose whether the new variable should be True or False. If you leave this input empty, the variable will default to False.
    • Type: True/False

Output

  • Variable name: This output provides a True/False value indicating whether the boolean variable was successfully created and stored in the application's memory. True means the variable was successfully created, and False means an error occurred during its creation.
    • Type: True/False

Execution Flow

Real-Life Examples

Here are some practical ways you can use the "Create a boolean" action:

Example 1: Setting a Feature Flag

Imagine you're building an application and want to enable or disable a new feature for certain users.

  • Inputs:
    • Value: True
  • Result: A new boolean variable is created with the value True. The "Variable name" output will be True, indicating that the feature flag variable was successfully set. You can then use this variable in conditional logic to show or hide the new feature.

Example 2: Tracking a Task Completion Status

You have a workflow where a user needs to complete a specific step, and you want to track if that step is done.

  • Inputs:
    • Value: False
  • Result: A new boolean variable is created with the value False. The "Variable name" output will be True, confirming the successful creation of the status variable. This variable can later be updated to True once the task is completed.

Example 3: Controlling UI Element Visibility

You want to show a "Save Changes" button only after a user has made modifications to a form.

  • Inputs:
    • Value: False
  • Result: A new boolean variable is created with the value False. The "Variable name" output will be True, indicating the variable is ready. Initially, the "Save Changes" button would be hidden. When the user starts typing, another action could update this boolean variable to True, making the button visible.