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
TrueorFalse. If you leave this input empty, the variable will default toFalse.- 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.
Truemeans the variable was successfully created, andFalsemeans 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
- Value:
- Result: A new boolean variable is created with the value
True. The "Variable name" output will beTrue, 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
- Value:
- Result: A new boolean variable is created with the value
False. The "Variable name" output will beTrue, confirming the successful creation of the status variable. This variable can later be updated toTrueonce 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
- Value:
- Result: A new boolean variable is created with the value
False. The "Variable name" output will beTrue, 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 toTrue, making the button visible.