> ## Documentation Index
> Fetch the complete documentation index at: https://docs-staging-quickstart-revamp.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

> Learn how to configure your logic flow actions to add if/then conditions, store shared variables, show error messages or map values.

# Logic

This list of logic actions allows you to add form conditional logic, store shared variables, map values, and to display custom error messages.

## If/then condition

Adds a conditional action with True / False branches to customize the behavior of the flow based on input or properties.

<Frame>
  <img src="https://mintcdn.com/docs-staging-quickstart-revamp/TYcLtS8UbiQUCV_p/images/cdy7uua7fh8z/4ehTUSu8W1LibUd1uj3x5s/00d76b15c68746ed74e44127804c9557/if-then-condition-action.png?fit=max&auto=format&n=TYcLtS8UbiQUCV_p&q=85&s=978687bb8bea87c7b81f6fbb22097dc8" alt="" width="1866" height="890" data-path="images/cdy7uua7fh8z/4ehTUSu8W1LibUd1uj3x5s/00d76b15c68746ed74e44127804c9557/if-then-condition-action.png" />
</Frame>

### Input settings

<table class="table">
  <thead>
    <tr>
      <th><b>Parameter</b></th>
      <th><b>Description</b></th>
    </tr>
  </thead>

  <tbody>
    <tr>
      <td>Condition</td>

      <td>
        Customizable conditional action that triggers <code>True</code> / <code>False</code> branches depending on its result. You can use the <code>AND</code> / <code>OR</code> operators to nest different conditions.
      </td>
    </tr>
  </tbody>
</table>

### Output response

<table class="table">
  <thead>
    <tr>
      <th><b>Property</b></th>
      <th><b>Type</b></th>
      <th><b>Description</b></th>
    </tr>
  </thead>

  <tbody>
    <tr>
      <td><code>result</code></td>
      <td>Boolean</td>
      <td>Returns a <code>true</code> or <code>false</code> response based on the condition result.</td>
    </tr>
  </tbody>
</table>

### Output object example

```json lines
{
  "result": true
}
```

## Store shared variable

Stores variables in a private state that is available in your form and across its flows.

You can reference these shared variables using `{{vars.*}}`**.** To learn more, read [Variables](/docs/customize/forms/variables).

<Frame>
  <img src="https://mintcdn.com/docs-staging-quickstart-revamp/R8rXfTj95YBIEuC2/images/cdy7uua7fh8z/4MO9wvChhnCJOg9OAdWuEf/98182a2bd8b6cf4c4baebefb96bce121/stored-shared-variable.png?fit=max&auto=format&n=R8rXfTj95YBIEuC2&q=85&s=a2625a1543ce88e245aa332330678288" alt="" width="757" height="338" data-path="images/cdy7uua7fh8z/4MO9wvChhnCJOg9OAdWuEf/98182a2bd8b6cf4c4baebefb96bce121/stored-shared-variable.png" />
</Frame>

### Input settings

<table class="table">
  <thead>
    <tr>
      <th><b>Parameter</b></th>
      <th><b>Description</b></th>
    </tr>
  </thead>

  <tbody>
    <tr>
      <td>Data fields</td>

      <td>
        The variables to be stored in a private state for use in your form and across its flow. Use key/value pairs to add variables.
      </td>
    </tr>
  </tbody>
</table>

## Show error message

Displays a custom error message to the user.

<Warning>
  This flow action terminates the Flow. Any actions inserted after it won't be executed.
</Warning>

<Frame>
  <img src="https://mintcdn.com/docs-staging-quickstart-revamp/AmyDKn5Na0kFZtbL/images/cdy7uua7fh8z/1Kd4SyaBtAC9S8nfWFeGfh/6e42b16c0ab69dc6d026fb3601133fbe/show-error-message-flow-action.png?fit=max&auto=format&n=AmyDKn5Na0kFZtbL&q=85&s=ef870d6505bfa9abd440b6f52a2bdd43" alt="" width="761" height="347" data-path="images/cdy7uua7fh8z/1Kd4SyaBtAC9S8nfWFeGfh/6e42b16c0ab69dc6d026fb3601133fbe/show-error-message-flow-action.png" />
</Frame>

### Input settings

<table class="table">
  <thead>
    <tr>
      <th><b>Parameter</b></th>
      <th><b>Description</b></th>
    </tr>
  </thead>

  <tbody>
    <tr>
      <td>Error message</td>

      <td>
        The error message to be displayed to the user.
      </td>
    </tr>
  </tbody>
</table>

## Input value mapping

Maps an input variable to an output based on its values.

<Frame>
  <img src="https://mintcdn.com/docs-staging-quickstart-revamp/TYcLtS8UbiQUCV_p/images/cdy7uua7fh8z/4VtAr4vCSXtKlSaxtiXQhV/bcb07221f688483aa2010d80394ae630/input-value-mapping.png?fit=max&auto=format&n=TYcLtS8UbiQUCV_p&q=85&s=bc7e0e16ca2e0ed504db68d7e04c4642" alt="" width="749" height="506" data-path="images/cdy7uua7fh8z/4VtAr4vCSXtKlSaxtiXQhV/bcb07221f688483aa2010d80394ae630/input-value-mapping.png" />
</Frame>

### Input settings

<table class="table">
  <thead>
    <tr>
      <th><b>Parameter</b></th>
      <th><b>Description</b></th>
    </tr>
  </thead>

  <tbody>
    <tr>
      <td>Input value (required)</td>

      <td>
        The input variable.
      </td>
    </tr>

    <tr>
      <td>Mapping table</td>

      <td>
        Map an input variable value an output.
      </td>
    </tr>

    <tr>
      <td>Default output value</td>

      <td>
        Sets a default output value to be used when no output value is set in the mapping table.
      </td>
    </tr>
  </tbody>
</table>

### Output response

<table class="table">
  <thead>
    <tr>
      <th>Property</th>
      <th>Type</th>
      <th>Description</th>
    </tr>
  </thead>

  <tbody>
    <tr>
      <td><code>result</code></td>
      <td>String</td>
      <td>Returns the value mapped to an input.</td>
    </tr>
  </tbody>
</table>

### Output object example

```json lines
{
	"result": "Please enter a valid email address."
}
```
