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

# Advanced Features

> Conditional logic, scoring, and advanced form configuration

# Advanced Features

GeniusForms supports powerful conditional logic, scoring rules, and time-based controls for building dynamic forms.

## Conditional Logic

Show or hide questions based on previous answers.

### Simple Conditions

Show a question only when another question has a specific answer:

```bash theme={null}
curl -X POST https://geniusforms.ai/api/v1/forms/208/fields \
  -H "X-API-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "type": "text",
    "question": "Please specify your other preference",
    "required": true,
    "conditionalLogic": {
      "showIf": {
        "questionId": 1,
        "operator": "equals",
        "value": "Other"
      }
    }
  }'
```

**Available Operators:**

| Operator     | Description    |
| ------------ | -------------- |
| `equals`     | Exact match    |
| `not_equals` | Does not match |

### Advanced Conditions

For complex logic with multiple conditions, AND/OR groups, and actions:

```json theme={null}
{
  "type": "textarea",
  "question": "Tell us more about your enterprise needs",
  "required": false,
  "conditionalLogic": {
    "advanced": {
      "conditionGroups": [
        {
          "id": "enterprise-check",
          "operator": "AND",
          "conditions": [
            {
              "id": "cond1",
              "questionId": 1,
              "operator": "equals",
              "value": "Enterprise",
              "valueType": "static"
            },
            {
              "id": "cond2",
              "questionId": 2,
              "operator": "greater_than",
              "value": 100,
              "valueType": "static"
            }
          ]
        }
      ],
      "actions": [
        {
          "type": "show_question",
          "targetId": 5
        }
      ]
    }
  }
}
```

**Advanced Operators:**

| Operator       | Description        |
| -------------- | ------------------ |
| `equals`       | Exact match        |
| `not_equals`   | Does not match     |
| `contains`     | Contains substring |
| `greater_than` | Numeric comparison |
| `less_than`    | Numeric comparison |
| `is_empty`     | Answer is empty    |
| `is_not_empty` | Answer has value   |

**Actions:**

| Action             | Description                 |
| ------------------ | --------------------------- |
| `show_question`    | Display a hidden question   |
| `hide_question`    | Hide a visible question     |
| `skip_to_section`  | Jump to a form section      |
| `skip_to_question` | Jump to a specific question |
| `end_form`         | Submit and end the form     |
| `set_score`        | Set a score value           |

## Scoring Rules

Calculate scores based on user answers — useful for quizzes, assessments, and lead qualification.

```json theme={null}
{
  "conditionalLogic": {
    "advanced": {
      "scoreRules": [
        {
          "id": "satisfaction-score",
          "questionId": 3,
          "scoreMap": {
            "Very Satisfied": 10,
            "Satisfied": 7,
            "Neutral": 5,
            "Dissatisfied": 2,
            "Very Dissatisfied": 0
          },
          "resetOnSection": false
        }
      ]
    }
  }
}
```

## Time-Based Rules

Control question visibility based on time conditions:

```json theme={null}
{
  "conditionalLogic": {
    "advanced": {
      "timeRules": [
        {
          "id": "limited-offer",
          "type": "date_range",
          "startDate": "2026-02-01T00:00:00Z",
          "endDate": "2026-02-28T23:59:59Z"
        }
      ]
    }
  }
}
```

**Time Rule Types:**

| Type               | Description                |
| ------------------ | -------------------------- |
| `specific_date`    | Show on a specific date    |
| `date_range`       | Show within date range     |
| `time_of_day`      | Show during specific hours |
| `day_of_week`      | Show on specific days      |
| `time_on_form`     | After X time on form       |
| `time_on_question` | After X time on question   |

## Complete Example: Lead Qualification Form

```bash theme={null}
curl -X POST https://geniusforms.ai/api/v1/forms \
  -H "X-API-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "title": "Lead Qualification",
    "description": "Qualify incoming leads",
    "questions": [
      {
        "type": "select",
        "question": "Company size",
        "options": ["1-10", "11-50", "51-200", "201-1000", "1000+"],
        "required": true
      },
      {
        "type": "select",
        "question": "Annual budget",
        "options": ["< $10k", "$10k-$50k", "$50k-$100k", "$100k+"],
        "required": true
      },
      {
        "type": "select",
        "question": "Timeline",
        "options": ["Immediately", "1-3 months", "3-6 months", "6+ months"],
        "required": true
      }
    ]
  }'
```

Then add a conditional follow-up for enterprise leads:

```bash theme={null}
curl -X POST https://geniusforms.ai/api/v1/forms/FORM_ID/fields \
  -H "X-API-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "type": "textarea",
    "question": "Describe your enterprise requirements",
    "required": false,
    "conditionalLogic": {
      "advanced": {
        "conditionGroups": [
          {
            "id": "high-value-lead",
            "operator": "AND",
            "conditions": [
              {
                "id": "c1",
                "questionId": 1,
                "operator": "equals",
                "value": "1000+",
                "valueType": "static"
              },
              {
                "id": "c2",
                "questionId": 2,
                "operator": "equals",
                "value": "$100k+",
                "valueType": "static"
              }
            ]
          }
        ]
      }
    }
  }'
```
