# CompareField

## CompareField (comparefield)

A compareField is a field that allows you to combine values from multiple fields. Thanks to this field you can combine several fields into one and send as e.g. request title.

*example:*

```JSON
{
  "fields": [ 
    {
      "id": "checkBoxField"
    },
    {
      "id": "textField"
    }
  ],
  "output": "${textField} <-> ${checkBoxField}"
}
```

<p class="callout warning">This field has no view, it is a virtual field!</p>

*<span style="text-decoration: underline;">For example:</span>*  
We have two fields "First name" and "Last name", we want these values to be sent as one field, e.g. the title of the request, and we also want to add "Your name:".

```JSON
{
  "fields": [
      {
	  	"id": "UserFirstName"
      },
      {
      	"id": "UserLastName"
      }
    ],
    "output": "Your Name: ${UserFirstName} ${UserLastName}"
}
```

Our fields:[![image-1590489835623.png](https://docs.intalioservices.com/uploads/images/gallery/2020-05/scaled-1680-/GbXC8189SoGn9OgQ-image-1590489835623.png)](https://docs.intalioservices.com/uploads/images/gallery/2020-05/GbXC8189SoGn9OgQ-image-1590489835623.png)

[![image-1590489849932.png](https://docs.intalioservices.com/uploads/images/gallery/2020-05/scaled-1680-/0VwB4uCmr6YK1ur7-image-1590489849932.png)](https://docs.intalioservices.com/uploads/images/gallery/2020-05/0VwB4uCmr6YK1ur7-image-1590489849932.png)

<p class="callout info">Field of type "compareField" had the identifier set to "UserFristNameAndLastName".   
Its output value was "Your Name: John Kowalski".</p>

### Use of variables:

<p class="callout warning">To combine the values of several fields, place the identifiers of these fields in two places.</p>

  
First, you need to activate a field in the "fields" parameter, and then determine in what form you want this field to be displayed by adding it to the "output" parameter.

In the output parameter you only need to use the following sequence ${field identifier}, the rest depends on your imagination.

### The rest of the available parameters:

<p class="callout info">This field supports all parameters with ["Attributes available for each field".](https://docs.intalioservices.com/books/dynamic-forms---installation-and-administrators-guide/page/attributes-available-for-each-field "Attributes available for each field")</p>