> ## Documentation Index
> Fetch the complete documentation index at: https://apidocs.neetoform.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Conditional logic and automation rules

> Show or hide questions based on answers, and run actions when a form is submitted.

A condition changes what a respondent sees while filling a form, for example showing a question only when an earlier answer is "Yes". An automation rule runs after a submission, for example emailing your sales team. For fields and response details, see the API reference for [conditions](https://apidocs.neetoform.com/api/conditions/list.md) and [automation rules](https://apidocs.neetoform.com/api/automation-rules/list.md).

Both groups of commands take the question ids from `neetoform forms questions list <form-id>`.

## List conditions

This command lists the conditional logic of a form in the order it is checked.

```bash theme={"system"}
neetoform forms conditions list 7db4b04a-6e17-4af6-a1d6-650c4cba3f91 --json
```

**Required arguments:**

* `<form-id>` - The form's UUID, from `neetoform forms list`

| Flag | Type | Required | Default | Description |
| - | - | - | - | - |
| `--page` | `int` | | `0` | Page number |
| `--page-size` | `int` | | `0` | Items per page (max 100) |

```json Sample output (--json) theme={"system"}
{
  "data": [
    {
      "id": "7c1d2b0e-3f7a-4c55-9d2e-0b8e1f6a9c11",
      "enabled": true,
      "priority": 1,
      "conditions": {
        "join_type": "and",
        "items": [
          {
            "field": "5b0d6a52-8c2e-4a43-b1c4-0f6a2f1d9e10",
            "verb": "is_equal",
            "record": "custom_value",
            "value": "Yes"
          }
        ]
      },
      "actions": {
        "items": [
          {
            "action_type": "show_multiple",
            "fields": ["9a3f4c1e-7d25-4e18-a6b0-3c2d8e5f7a21"]
          }
        ]
      },
      "created_at": "2026-10-28T09:12:44.120Z",
      "updated_at": "2026-10-28T09:12:44.120Z"
    }
  ],
  "breadcrumbs": [
    {
      "label": "Show",
      "command": "neetoform forms conditions show <form-id> <condition-id>"
    }
  ],
  "pagination": {
    "current_page_number": 1,
    "total_pages": 1,
    "total_records": 1,
    "page_size": 30
  }
}
```

## Show a condition

This command shows one condition of a form.

```bash theme={"system"}
neetoform forms conditions show 7db4b04a-6e17-4af6-a1d6-650c4cba3f91 7c1d2b0e-3f7a-4c55-9d2e-0b8e1f6a9c11 --json
```

**Required arguments:**

* `<form-id>` - The form's UUID, from `neetoform forms list`
* `<condition-id>` - The condition's UUID, from `neetoform forms conditions list`

## Create a condition

This command creates a condition. It is added after the last one.

```bash theme={"system"}
neetoform forms conditions create 7db4b04a-6e17-4af6-a1d6-650c4cba3f91 --json-file condition.json
```

**Required arguments:**

* `<form-id>` - The form's UUID, from `neetoform forms list`

| Flag | Type | Required | Default | Description |
| - | - | - | - | - |
| `--enabled` | `bool` | | `true` | Turn the condition on or off |
| `--json-file` | `string` | | | Path to a JSON file with the condition, e.g. \{"conditions":\{"join\_type":"and","items":\[\{"field":"\<question-id>","verb":"is\_equal","record":"custom\_value","value":"Yes"}]},"actions":\{"items":\[\{"action\_type":"show","fields":\["\<question-id>"]}]}} |

`--json-file` holds the condition: a `conditions` object with the tests, and an `actions` object with what happens when they match. `join_type` is `and` (all items must match) or `or` (any item). In an item, `record` is `custom_value` to compare with `value`, or the id of another question to compare with its answer. For choice questions, `value` is the id of the option. This file shows the question `9a3f...` only when question `5b0d...` is answered "Yes":

```json theme={"system"}
{
  "conditions": {
    "join_type": "and",
    "items": [
      {
        "field": "5b0d6a52-8c2e-4a43-b1c4-0f6a2f1d9e10",
        "verb": "is_equal",
        "record": "custom_value",
        "value": "Yes"
      }
    ]
  },
  "actions": {
    "items": [
      {
        "action_type": "show_multiple",
        "fields": ["9a3f4c1e-7d25-4e18-a6b0-3c2d8e5f7a21"]
      }
    ]
  }
}
```

Every key is optional. `--enabled` turns the condition on or off and overrides `enabled` in the file; it defaults to on. The values of `verb` and `action_type` are stored as you send them, so check the spelling against the API reference.

## Update a condition

This command changes a condition. Send only the keys you want to change.

```bash theme={"system"}
neetoform forms conditions update 7db4b04a-6e17-4af6-a1d6-650c4cba3f91 7c1d2b0e-3f7a-4c55-9d2e-0b8e1f6a9c11 --enabled=false
```

**Required arguments:**

* `<form-id>` - The form's UUID, from `neetoform forms list`
* `<condition-id>` - The condition's UUID, from `neetoform forms conditions list`

| Flag | Type | Required | Default | Description |
| - | - | - | - | - |
| `--enabled` | `bool` | | `true` | Turn the condition on or off |
| `--json-file` | `string` | | | Path to a JSON file with the condition, e.g. \{"conditions":\{"join\_type":"and","items":\[\{"field":"\<question-id>","verb":"is\_equal","record":"custom\_value","value":"Yes"}]},"actions":\{"items":\[\{"action\_type":"show","fields":\["\<question-id>"]}]}} |

When the file has `conditions` or `actions`, it replaces the whole current value, so include every item you want to keep.

## Delete a condition

This command deletes a condition.

```bash theme={"system"}
neetoform forms conditions delete 7db4b04a-6e17-4af6-a1d6-650c4cba3f91 7c1d2b0e-3f7a-4c55-9d2e-0b8e1f6a9c11
```

**Required arguments:**

* `<form-id>` - The form's UUID, from `neetoform forms list`
* `<condition-id>` - The condition's UUID, from `neetoform forms conditions list`

## Clone a condition

This command copies a condition. Use this when a new condition is close to an existing one.

```bash theme={"system"}
neetoform forms conditions clone 7db4b04a-6e17-4af6-a1d6-650c4cba3f91 7c1d2b0e-3f7a-4c55-9d2e-0b8e1f6a9c11
```

**Required arguments:**

* `<form-id>` - The form's UUID, from `neetoform forms list`
* `<condition-id>` - The condition's UUID, from `neetoform forms conditions list`

## Reorder conditions

This command sets the order in which conditions are checked.

```bash theme={"system"}
neetoform forms conditions reorder 7db4b04a-6e17-4af6-a1d6-650c4cba3f91 --ids 7c1d...,2e9a...
```

**Required arguments:**

* `<form-id>` - The form's UUID, from `neetoform forms list`

| Flag | Type | Required | Default | Description |
| - | - | - | - | - |
| `--ids` | `string` | Yes | | Every condition id of the form in the new order, comma-separated |

`--ids` must list every condition id of the form.

## List automation rules

This command lists the automation rules of a form. Use `--search` to match words in a rule's name, description or condition field.

```bash theme={"system"}
neetoform forms automation-rules list 7db4b04a-6e17-4af6-a1d6-650c4cba3f91 --search sales --json
```

**Required arguments:**

* `<form-id>` - The form's UUID, from `neetoform forms list`

| Flag | Type | Required | Default | Description |
| - | - | - | - | - |
| `--page` | `int` | | `0` | Page number |
| `--page-size` | `int` | | `0` | Items per page (max 100) |
| `--search` | `string` | | | Words to match in the rule name, description or condition field |

```json Sample output (--json) theme={"system"}
{
  "data": [
    {
      "id": "0d4a5b8e-2f61-4b0c-8a3e-5f7c9e2d1a44",
      "name": "Email the sales team",
      "description": "New leads",
      "status": "enabled",
      "performer": "any",
      "display_order": 1,
      "disabled_reason": null,
      "execution_delay": { "value": 5, "unit": "minutes" },
      "created_at": "2026-10-28T09:12:44.120Z",
      "updated_at": "2026-10-28T09:12:44.120Z"
    }
  ],
  "breadcrumbs": [
    {
      "label": "Show",
      "command": "neetoform forms automation-rules show <form-id> <rule-id>"
    }
  ],
  "pagination": {
    "current_page_number": 1,
    "total_pages": 1,
    "total_records": 1,
    "page_size": 30
  }
}
```

The list shows a summary of each rule. Run `show` to see its events, conditions and actions.

## Show an automation rule

This command shows one rule with its events, conditions and actions.

```bash theme={"system"}
neetoform forms automation-rules show 7db4b04a-6e17-4af6-a1d6-650c4cba3f91 0d4a5b8e-2f61-4b0c-8a3e-5f7c9e2d1a44 --json
```

**Required arguments:**

* `<form-id>` - The form's UUID, from `neetoform forms list`
* `<rule-id>` - The rule's UUID, from `neetoform forms automation-rules list`

## Create an automation rule

This command creates a rule. A rule runs its actions, such as sending an email or calling an API endpoint, when its events happen and its conditions match.

```bash theme={"system"}
neetoform forms automation-rules create 7db4b04a-6e17-4af6-a1d6-650c4cba3f91 \
  --name "Email the sales team" \
  --events submission_created \
  --delay-value 5 --delay-unit minutes \
  --json-file rule.json
```

**Required arguments:**

* `<form-id>` - The form's UUID, from `neetoform forms list`

| Flag | Type | Required | Default | Description |
| - | - | - | - | - |
| `--delay-unit` | `string` | | | Delay unit: minutes, hours or days |
| `--delay-value` | `int` | | `0` | Delay before the actions run, 1 to 15 |
| `--description` | `string` | | | Rule description |
| `--events` | `string` | | | Comma-separated events: submission\_created, custom\_field\_updated |
| `--json-file` | `string` | | | Path to a JSON file with the rule; flags override it, e.g. \{"conditions":\[\{"field":"\<question-id>","kind":"record","verb":"contains","join\_type":"and\_operator","metadata":\{"value":"@example.com"}}],"actions":\[\{"name":"email\_to","metadata":\{"subject":"New lead","body":"\{\{all-answers}}","emails":\["[sales@example.com](mailto:sales@example.com)"]}}]} |
| `--name` | `string` | Yes | | Rule name, unique within the form |
| `--performer` | `string` | | | any, or an organization role name that must perform the action |
| `--status` | `string` | | | enabled or disabled |

`--name` is required and must be unique in the form, ignoring case. `--status` accepts `enabled` or `disabled`, `--events` accepts `submission_created` and `custom_field_updated`, and `--delay-unit` accepts `minutes`, `hours` or `days`. Wrong values are rejected before a request is made.

`--json-file` holds the `conditions` and `actions` of the rule, and may also hold the other fields. A flag overrides the same key in the file. This file sends the answers to the sales team when the email address of question `5b0d...` contains `@example.com`:

```json theme={"system"}
{
  "conditions": [
    {
      "field": "5b0d6a52-8c2e-4a43-b1c4-0f6a2f1d9e10",
      "kind": "record",
      "verb": "contains",
      "join_type": "and_operator",
      "metadata": { "value": "@example.com" }
    }
  ],
  "actions": [
    {
      "name": "email_to",
      "metadata": {
        "subject": "New lead",
        "body": "{{all-answers}}",
        "emails": ["sales@example.com"]
      }
    }
  ]
}
```

Actions such as `email_to` and `sms_to` contact real people as soon as the rule is enabled and a submission arrives. Create the rule with `--status disabled` while you test it.

## Update an automation rule

This command changes a rule. Only the fields you pass change.

```bash theme={"system"}
neetoform forms automation-rules update 7db4b04a-6e17-4af6-a1d6-650c4cba3f91 0d4a5b8e-2f61-4b0c-8a3e-5f7c9e2d1a44 --status disabled
```

**Required arguments:**

* `<form-id>` - The form's UUID, from `neetoform forms list`
* `<rule-id>` - The rule's UUID, from `neetoform forms automation-rules list`

| Flag | Type | Required | Default | Description |
| - | - | - | - | - |
| `--delay-unit` | `string` | | | Delay unit: minutes, hours or days |
| `--delay-value` | `int` | | `0` | Delay before the actions run, 1 to 15 |
| `--description` | `string` | | | Rule description |
| `--events` | `string` | | | Comma-separated events: submission\_created, custom\_field\_updated |
| `--json-file` | `string` | | | Path to a JSON file with the rule; flags override it, e.g. \{"conditions":\[\{"field":"\<question-id>","kind":"record","verb":"contains","join\_type":"and\_operator","metadata":\{"value":"@example.com"}}],"actions":\[\{"name":"email\_to","metadata":\{"subject":"New lead","body":"\{\{all-answers}}","emails":\["[sales@example.com](mailto:sales@example.com)"]}}]} |
| `--name` | `string` | | | Rule name, unique within the form |
| `--performer` | `string` | | | any, or an organization role name that must perform the action |
| `--status` | `string` | | | enabled or disabled |

## Delete an automation rule

This command deletes a rule.

```bash theme={"system"}
neetoform forms automation-rules delete 7db4b04a-6e17-4af6-a1d6-650c4cba3f91 0d4a5b8e-2f61-4b0c-8a3e-5f7c9e2d1a44
```

**Required arguments:**

* `<form-id>` - The form's UUID, from `neetoform forms list`
* `<rule-id>` - The rule's UUID, from `neetoform forms automation-rules list`

## Clone an automation rule

This command copies a rule. Use this when a new rule is close to an existing one.

```bash theme={"system"}
neetoform forms automation-rules clone 7db4b04a-6e17-4af6-a1d6-650c4cba3f91 0d4a5b8e-2f61-4b0c-8a3e-5f7c9e2d1a44
```

**Required arguments:**

* `<form-id>` - The form's UUID, from `neetoform forms list`
* `<rule-id>` - The rule's UUID, from `neetoform forms automation-rules list`

## Reorder automation rules

This command sets the order in which rules run.

```bash theme={"system"}
neetoform forms automation-rules reorder 7db4b04a-6e17-4af6-a1d6-650c4cba3f91 --ids 0d4a...,8c1e...
```

**Required arguments:**

* `<form-id>` - The form's UUID, from `neetoform forms list`

| Flag | Type | Required | Default | Description |
| - | - | - | - | - |
| `--ids` | `string` | Yes | | Every rule id of the form in the new order, comma-separated |

`--ids` must list every rule id of the form.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.