> For the complete documentation index, see [llms.txt](https://docs.api.intratool.de/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.api.intratool.de/api-reference/forms/form-field-display-conditions.md).

# FormFieldDisplayConditions

## Introduction

`FormFieldDisplayConditions` attach conditional visibility rules to [FormFields](/api-reference/forms/form-fields.md).

## Model Definition

**Alias**

`formFieldDisplayCondition`

## Admin: Create

Create a new `FormFieldDisplayCondition`.

**Definition**

<mark style="color:yellow;">`POST`</mark> `/api/administration/forms/fields/display-conditions`

**Request Keys**

| Key                 | Type      | Default | Description                                              |
| ------------------- | --------- | ------- | -------------------------------------------------------- |
| `attachable_type`\* | `string`  | -       | Supported morph alias. Use `formField` for a form field. |
| `attachable_id`\*   | `integer` | -       | ID of the entity receiving the condition.                |

Keys with `*` are required.

**Example Request**

{% tabs %}
{% tab title="PHP" %}

```php
$client = new GuzzleHttp\Client(['base_uri' => 'https://{tenant}.intratool.de']);
$response = $client->request('POST', '/api/administration/forms/fields/display-conditions', [
    'headers' => ['Authorization' => "Bearer {accessToken}"],
    'json' => [
        'attachable_type' => 'formField',
        'attachable_id' => 33
    ]
]);
```

{% endtab %}
{% endtabs %}

**Example Response**

```json
{
  "status": "success",
  "data": {
    "id": 77,
    "attachable_type": "formField",
    "attachable_id": "33",
    "condition_groups": [],
    "single_conditions": []
  }
}
```

## Admin: Update

Update an existing `FormFieldDisplayCondition`.

**Definition**

<mark style="color:blue;">`PUT`</mark> `/api/administration/forms/fields/display-conditions/{formFieldDisplayCondition}`

**Route Parameters**

| Parameter                   | Type      | Description           |
| --------------------------- | --------- | --------------------- |
| `formFieldDisplayCondition` | `integer` | Display condition ID. |

**Request Keys**

| Key               | Type      | Default       | Description                |
| ----------------- | --------- | ------------- | -------------------------- |
| `attachable_type` | `string`  | Current value | New supported morph alias. |
| `attachable_id`   | `integer` | Current value | New attachable entity ID.  |

**Behavior**

When changing the attachment, provide both values so the morph type can be resolved against the new entity.

**Example Request**

{% tabs %}
{% tab title="PHP" %}

```php
$client = new GuzzleHttp\Client(['base_uri' => 'https://{tenant}.intratool.de']);
$response = $client->request('PUT', '/api/administration/forms/fields/display-conditions/77', [
    'headers' => ['Authorization' => "Bearer {accessToken}"],
    'json' => [
        'attachable_type' => 'formField',
        'attachable_id' => 34
    ]
]);
```

{% endtab %}
{% endtabs %}

**Example Response**

```json
{
  "status": "success",
  "data": {
    "id": 77,
    "attachable_type": "formField",
    "attachable_id": "34",
    "condition_groups": [],
    "single_conditions": []
  }
}
```

## Admin: Delete

Delete an existing `FormFieldDisplayCondition`.

**Definition**

<mark style="color:red;">`DELETE`</mark> `/api/administration/forms/fields/display-conditions/{formFieldDisplayCondition}`

**Route Parameters**

| Parameter                   | Type      | Description           |
| --------------------------- | --------- | --------------------- |
| `formFieldDisplayCondition` | `integer` | Display condition ID. |

**Example Request**

{% tabs %}
{% tab title="PHP" %}

```php
$client = new GuzzleHttp\Client(['base_uri' => 'https://{tenant}.intratool.de']);
$response = $client->request('DELETE', '/api/administration/forms/fields/display-conditions/77', [
    'headers' => ['Authorization' => "Bearer {accessToken}"]
]);
```

{% endtab %}
{% endtabs %}

**Example Response**

```json
{
  "status": "success",
  "data": null
}
```
