# FormMessageFields

## Introduction

`FormMessageFields` represent the input values for [FormFields](/api-reference/forms/form-fields.md) that are sent when a [User](/api-reference/users.md) submits a [Form](/api-reference/forms/forms.md).

Every submitted [Form](/api-reference/forms/forms.md) will have a set of `FormMessageFields` as value representations according to the defined [FormFields](/api-reference/forms/form-fields.md) when saved.

The values of `FormMessageFields` result in a [FormMessage](/api-reference/forms/form-messages.md) after processing, which is then sent via E-Mail.

## Model Definition

**Relations**

| Relation                                             | Key           | Type       | Relation Field(s) |
| ---------------------------------------------------- | ------------- | ---------- | ----------------- |
| [FormField](/api-reference/forms/form-fields.md)     | `formField`   | Belongs to | `form_field_id`   |
| [FormMessage](/api-reference/forms/form-messages.md) | `formMessage` | Belongs to | `form_message_id` |

## List by message

Get a list of `FormMessageFields` for the given [FormMessage](/api-reference/forms/form-messages.md).

**Definition**

<mark style="color:green;">`GET`</mark> `/api/forms/messages/{formMessageId}/fields`

**Example Request**

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

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

{% endtab %}
{% endtabs %}

**Example Response**

```json
[
  {
    "id": 1,
    "form_message_id": 1,
    "form_field_id": 1,
    "value": "1",
    "request_value": "1",
    "created_at": "2024-10-01 12:00:00",
    "updated_at": "2024-10-01 12:00:00",
    "deleted_at": null
  },
  {
    "id": 2,
    "form_message_id": 1,
    "form_field_id": 2,
    "value": "2",
    "request_value": "2",
    "created_at": "2024-10-01 12:00:00",
    "updated_at": "2024-10-01 12:00:00",
    "deleted_at": null
  },
  {
    "id": 3,
    "form_message_id": 1,
    "form_field_id": 3,
    "value": "3",
    "request_value": "3",
    "created_at": "2024-10-01 12:00:00",
    "updated_at": "2024-10-01 12:00:00",
    "deleted_at": null
  }
]
```

## Show by message and field

Show a single `FormMessageField` for the given [FormMessage](/api-reference/forms/form-messages.md) and [FormField](/api-reference/forms/form-fields.md).

**Definition**

<mark style="color:green;">`GET`</mark> `/api/forms/messages/{formMessageId}/fields/{formFieldId}`

**Example Request**

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

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

{% endtab %}
{% endtabs %}

**Example Response**

```json
{
  "id": 1,
  "form_message_id": 1,
  "form_field_id": 1,
  "value": "1",
  "request_value": "1",
  "created_at": "2024-10-01 12:00:00",
  "updated_at": "2024-10-01 12:00:00",
  "deleted_at": null
}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.api.intratool.de/api-reference/forms/form-message-fields.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
