# Collection

## Specification

### spec

* Type: `Array`
* Description of the collection.
* Array of parameters. Standard parameters syntax is used.

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

```json
{
    "name": "myCollection",
    "type": "collection",
    "label": "My Collection",
    "spec": [
        {
            "name": "email",
            "type": "email"
        },
        {
            "name": "phone",
            "type": "text"
        }
    ]
}
```

{% endtab %}
{% endtabs %}

### sequence

* Type: `Boolean`
* If set to `true` , all properties of the object will be in the same order as they are defined in the `spec`.

## Examples

### Simple collection

Create a collection by specifying its parameters in the `spec`.

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

<div align="left"><figure><img src="/files/CfyA15LVTLmPSRO6KzAX" alt="" width="543"><figcaption></figcaption></figure></div>
{% endtab %}

{% tab title="Source" %}

```json
[
	{
		"name": "contact",
		"spec": [
			{
				"name": "firstname",
				"type": "text",
				"label": "First name"
			},
			{
				"name": "lastname",
				"type": "text",
				"label": "Last name"
			}
		],
		"type": "collection",
		"label": "Contact"
	}
]
```

{% endtab %}

{% tab title="Output" %}

```json
{
    "contact": {
        "lastname": "Doe",
        "firstname": "Jane"
    }
}
```

{% endtab %}
{% endtabs %}

### Collection in a collection

Collections can be also nested in another collection.

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

<div align="left"><figure><img src="/files/HmddPdLteQ9SytLxjk35" alt="" width="543"><figcaption></figcaption></figure></div>
{% endtab %}

{% tab title="Source" %}

```json
[
	{
		"name": "contact",
		"spec": [
			{
				"name": "firstname",
				"type": "text",
				"label": "First name"
			},
			{
				"name": "lastname",
				"type": "text",
				"label": "Last name"
			},
			{
				"name": "address",
				"label": "Address",
				"type": "collection",
				"spec": [
					{
						"label": "Street",
						"name": "street",
						"type": "text"
					},
					{
						"label": "City",
						"name": "city",
						"type": "text"
					}
				]
			}
		],
		"type": "collection",
		"label": "Contact"
	}
]
```

{% endtab %}

{% tab title="Output" %}

```json
{
    "contact": {
        "address": {
               "city": "Prague",
               "street": "Novakovych"
         },
        "lastname": "Doe",
        "firstname": "Jane"
    }
}
```

{% endtab %}
{% endtabs %}


---

# 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://developers.make.com/custom-apps-documentation/block-elements/parameters/collection.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.
