> ## Documentation Index
> Fetch the complete documentation index at: https://docs-dev-fix-docs-5546-update-db-search.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-dev-fix-docs-5546-update-db-search/67sfVHkxEzvbg1jW/docs/images/cdy7uua7fh8z/4ehTUSu8W1LibUd1uj3x5s/00d76b15c68746ed74e44127804c9557/if-then-condition-action.png?fit=max&auto=format&n=67sfVHkxEzvbg1jW&q=85&s=fa9b75ec46d890d3662b0516095ba5cc" alt="" width="1866" height="890" data-path="docs/images/cdy7uua7fh8z/4ehTUSu8W1LibUd1uj3x5s/00d76b15c68746ed74e44127804c9557/if-then-condition-action.png" />
</Frame>

### Input settings

| Parameter | Description                                                                                                                                                           |
| --------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Condition | Customizable conditional action that triggers `True` / `False` branches depending on its result. You can use the `AND` / `OR` operators to nest different conditions. |

### Output object

| Property | Type    | Description                                                         |
| -------- | ------- | ------------------------------------------------------------------- |
| `result` | Boolean | Returns a `true` or `false` response based on the condition result. |

### Output object example

```json lines theme={null}
{
  "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-dev-fix-docs-5546-update-db-search/fBAAWcVlHt01VWKN/docs/images/cdy7uua7fh8z/4MO9wvChhnCJOg9OAdWuEf/98182a2bd8b6cf4c4baebefb96bce121/stored-shared-variable.png?fit=max&auto=format&n=fBAAWcVlHt01VWKN&q=85&s=d0a893caaeb02d78dfbeacfdfcbcb6b4" alt="" width="757" height="338" data-path="docs/images/cdy7uua7fh8z/4MO9wvChhnCJOg9OAdWuEf/98182a2bd8b6cf4c4baebefb96bce121/stored-shared-variable.png" />
</Frame>

### Input settings

| Parameter   | Description                                                                                                                   |
| ----------- | ----------------------------------------------------------------------------------------------------------------------------- |
| Data fields | 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. |

## 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-dev-fix-docs-5546-update-db-search/QuIsP0pVvIDgvY8x/docs/images/cdy7uua7fh8z/1Kd4SyaBtAC9S8nfWFeGfh/6e42b16c0ab69dc6d026fb3601133fbe/show-error-message-flow-action.png?fit=max&auto=format&n=QuIsP0pVvIDgvY8x&q=85&s=73779b499b437511ef0e025a7ada2137" alt="" width="761" height="347" data-path="docs/images/cdy7uua7fh8z/1Kd4SyaBtAC9S8nfWFeGfh/6e42b16c0ab69dc6d026fb3601133fbe/show-error-message-flow-action.png" />
</Frame>

### Input settings

| Parameter     | Description                                    |
| ------------- | ---------------------------------------------- |
| Error message | The error message to be displayed to the user. |

## Input value mapping

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

<Frame>
  <img src="https://mintcdn.com/docs-dev-fix-docs-5546-update-db-search/67sfVHkxEzvbg1jW/docs/images/cdy7uua7fh8z/4VtAr4vCSXtKlSaxtiXQhV/bcb07221f688483aa2010d80394ae630/input-value-mapping.png?fit=max&auto=format&n=67sfVHkxEzvbg1jW&q=85&s=ba2cdcf3028a6936ebc1db10fba480bb" alt="" width="749" height="506" data-path="docs/images/cdy7uua7fh8z/4VtAr4vCSXtKlSaxtiXQhV/bcb07221f688483aa2010d80394ae630/input-value-mapping.png" />
</Frame>

### Input settings

| Parameter              | Description                                                                              |
| ---------------------- | ---------------------------------------------------------------------------------------- |
| Input value (required) | The input variable.                                                                      |
| Mapping table          | Map an input variable value an output.                                                   |
| Default output value   | Sets a default output value to be used when no output value is set in the mapping table. |

### Output object

| Property | Type   | Description                           |
| -------- | ------ | ------------------------------------- |
| `result` | String | Returns the value mapped to an input. |

### Output object example

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