---
title: DEEP_MERGE
url: https://www.tines.com/docs/formulas/functions/deep-merge/
kind: formula-function
---

*[tines.com](https://www.tines.com/llms.txt) › [Docs](https://www.tines.com/llms.txt) › [Formulas](https://www.tines.com/llm/docs/formulas.md) › [Functions](https://www.tines.com/llm/docs/formulas/functions.md)*

# DEEP_MERGE

*[View on tines.com](https://www.tines.com/docs/formulas/functions/deep-merge/)*

Creates a new object by recursively merging two or more objects together. Where there are key collisions that last value is used.

**Categories:** Objects

## Syntax

```
DEEP_MERGE(object, object, ...)
```

## Examples

### Example 1

Input:

```json
{
  "object_1": {
    "location": {
      "city": "Dublin"
    }
  },
  "object_2": {
    "location": {
      "country": "Ireland"
    }
  }
}
```

Formula:

```
DEEP_MERGE(object_1, object_2)
```

Output:

```json
{
  "location": {
    "city": "Dublin",
    "country": "Ireland"
  }
}
```

### Example 2

Input:

```json
{
  "object_1": {
    "location": {
      "city": "Dublin"
    }
  },
  "object_2": {
    "location": {
      "city": "Cork"
    }
  }
}
```

Formula:

```
DEEP_MERGE(object_1, object_2)
```

Output:

```json
{
  "location": {
    "city": "Cork"
  }
}
```

## Sample actions

```json
{
  "standardLibVersion": "13",
  "actionRuntimeVersion": "1",
  "agents": [
    {
      "disabled": false,
      "name": "DEEP MERGE",
      "description": "",
      "options": {
        "mode": "message_only",
        "loop": false,
        "payload": {
          "deep_merge": "=DEEP_MERGE(my_action.obj4, my_action.obj5)"
        }
      },
      "position": {
        "x": -6555,
        "y": -1380
      },
      "type": "eventTransformation",
      "timeSavedUnit": "minutes",
      "timeSavedValue": 0,
      "monitorAllEvents": false,
      "monitorFailures": false,
      "monitorNoEventsEmitted": null,
      "form": null
    },
    {
      "disabled": false,
      "name": "My Action",
      "description": "",
      "options": {
        "mode": "message_only",
        "loop": false,
        "payload": {
          "obj4": {
            "vegetable": "carrot",
            "nested": {
              "weather": "rain"
            }
          },
          "obj5": {
            "city": "Dublin",
            "nested": {
              "country": "Ireland"
            }
          }
        }
      },
      "position": {
        "x": -6555,
        "y": -1485
      },
      "type": "eventTransformation",
      "timeSavedUnit": "minutes",
      "timeSavedValue": 0,
      "monitorAllEvents": false,
      "monitorFailures": false,
      "monitorNoEventsEmitted": null,
      "form": null
    }
  ],
  "links": [
    {
      "sourceIdentifier": 1,
      "receiverIdentifier": 0
    }
  ],
  "diagramNotes": []
}
```
