---
# System prepended metadata

title: Logic Flow

---

---
title: "Logic Flow"
description: Logic Flow
---

The logic flow in the `settings.json` files is the brains behind telling your form which card step should come next. It allows you to create a customizable experience that ensures that users won't encounter irrelevant questions. The **"flow"** applies rules to when the **"cards"** should show from the settings file.

Within the flow object there are three different flow types, but two of the three are exclusively for creating an appointment booking experience.

1. **normal**
2. **cancel** - _appointments only_
3. **reschedule** - _appointments only_

```js
{
 "flow": {
    "normal": {...},
    "cancel": {...}
    },
    "reschedule": {...}
  }
}
```

## Normal Flow

The normal flow contains primary logic for each card step where each piece of logic for each card is contained within an object where the key is the card's name, and the value is a set of actions (or instructions) for the next step.

If you're not using appointment booking

### Next Action

The rules for what step comes next after a card is answered live within the `next` property in the actions array.

```js
{
  "normal": {
    "intro": { // Card Name from the "cards" object in the settings.json file
      "actions": [
        {
          "next": "submit_form_step" // Go to this card step.
        }
      ]
    },
    "submit_form_step": {
      "actions": [
        {
          "next": "finish_step"
        }
      ]
    }
  }
}
```

### Next Logic

Each card may have many different available next steps based on what the user has selected.

```js
{
  "intro": { // Card Name
    "actions": [
      {
        "next": "pop_question" // Card Name
      }
    ]
  },
  "pop_question": {
    "actions": [
      {
        "next": "stone_type"
      }
    ]
  },
  "stone_type": {
    "actions": [
      {
        "next": "ring_type_natural",
        "condition": {
          "op": "all_of",
          "values": ["Natural Diamond"]
        }
      },
      {
        "next": "ring_type_lab",
        "condition": {
          "op": "all_of",
          "values": ["Lab Diamond"]
        }
      }
    ]
  },
  "ring_type_natural": {
    "actions": [
      {
        "next": "submit_form_step"
      }
    ]
  },
  "ring_type_lab": {
    "actions": [
      {
        "next": "submit_form_step"
      }
    ]
  },
  "submit_form_step": {
    "actions": [
      {
        "next": "finish_step"
      }
    ]
  }
}
```
