Ask AI
Skip to main content

Create a boolean

Function: Create a boolean

This action allows you to create a new True/False variable within your application's memory (called the "variable scope"). You can then use this variable in other actions or display its value in your user interface.

Input

  • Value (BOOLEAN): The True or False value you want to assign to your new variable. If you don't provide a value, it will default to False.

Output

  • Variable name (BOOLEAN): This output indicates whether the boolean variable was successfully created and assigned a name. It will be True if the operation was successful, and False if there was an issue during creation.

Execution Flow

Real-Life Examples

Here are some examples of how you might use the "Create a boolean" action:

Example 1: Setting a Feature Flag

Imagine you want to control whether a new feature is visible to 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 variable was successfully created. You can then use this variable to show or hide the new feature.

Example 2: Tracking User Consent

You might need to record if a user has agreed to terms and conditions.

  • Inputs:
    • Value: False
  • Result: A new boolean variable is created with the value False. The 'Variable name' output will be True, confirming the variable's creation. This variable can later be updated to True if the user accepts.

Example 3: Initializing a Status Check

When a process starts, you might want a variable to indicate its initial state.

  • Inputs:
    • Value: True
  • Result: A new boolean variable is created with the value True. The 'Variable name' output will be True, signifying that the variable was successfully set up. This variable can then be used to track the ongoing status of the process.