> 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/tasks-2/task-field-display-conditions.md).

# TaskFieldDisplayConditions

## Introduction

`TaskFieldDisplayConditions` attach conditional visibility behavior to [TaskFields](/api-reference/tasks-2/task-fields.md).

## Model Definition

**Alias**

`formFieldDisplayCondition`

## Admin: Create

Create a new `TaskFieldDisplayCondition`.

**Definition**

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

**Request Keys**

| Key                 | Type     | Default | Description                                        |
| ------------------- | -------- | ------- | -------------------------------------------------- |
| `attachable_type`\* | `string` | -       | Morph alias of attachable entity. Use `formField`. |
| `attachable_id`\*   | `string` | -       | ID of attachable task field entity.                |

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/tasks-2/templates/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"
  }
}
```

## Admin: Update

Update an existing `TaskFieldDisplayCondition`.

**Definition**

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

**Route Parameters**

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

**Request Keys**

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

**Behavior**

* When the attachment changes, both `attachable_type` and `attachable_id` must resolve to a supported entity the user may configure.

**Example Request**

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

```php
$client = new GuzzleHttp\Client(['base_uri' => 'https://{tenant}.intratool.de']);
$response = $client->request('PUT', '/api/administration/tasks-2/templates/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"
  }
}
```

## Admin: Delete

Delete an existing `TaskFieldDisplayCondition`.

**Definition**

<mark style="color:red;">`DELETE`</mark> `/api/administration/tasks-2/templates/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/tasks-2/templates/fields/display-conditions/77', [
    'headers' => ['Authorization' => "Bearer {accessToken}"]
]);
```

{% endtab %}
{% endtabs %}

**Example Response**

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