---
updatedAt: 2025-12-05T18:41:41.000Z
agentTools:
  projectIndex: https://docs.observeinc.com/llms.txt
---

# merge_objects

```
merge_objects([object: object]+) -> object
```

Merge one or more objects into a single object.

Values for keys of later arguments overwrite those same keys from earlier arguments. Requires at least one object argument.

# Domain

This is a scalar function (calculates a single output value for a single input row).

# Categories

* [Semistructured](function#semistructured-functions)

# Examples

<OpalCodeBlock code={
`make_col obj1:object(parse_json(string1)), obj2:object(parse_json(string2))
make_col obj_merged:merge_objects(obj1, obj2)
drop_col obj1, obj2, string1, string2
`}/>

First, parses the columns `string1` and `string2` as JSON objects, storing the results into the columns `col1` and `col2`.
Then, merges `obj1` and `obj2` into the column `obj_merged`, giving keys in `obj2` precedence over keys with the same name in `obj1`.
Finally, cleans up the dataset by dropping the intermediate columns.