---
title: "upsert item to array · RUAL Documentation"
description: "inserts or updates an object within the given field by the unique key(s)"
canonical: https://docs.rual.nl/block-types/mutations/mutations_array_upsert
language: en
---

# upsert item to array

This block is part of the [`mutations`](https://docs.rual.nl/block-types/mutations) group and was last modified in core [`v13.0.4`](https://docs.rual.nl/core-versions/130004).

### Field Selection Required

This block relies on a field that you select to perform its data actions. You must manually select the field you want to use in your flow using the field selector modal. To access the modal, click the white button on the block.

inserts or updates an object within the given field by the unique key(s)

- match keys required `array` one or multiple keys to match the object to, e.g. `code` field within the item object

- item required `object` item to either insert or update within the given field

- mutations `mutations`

A typical wiring for [upsert item to array](https://docs.rual.nl/block-types/mutations/mutations_array_upsert): [with values](https://docs.rual.nl/block-types/array/array_of_values) feeds the `keys` pin; [new object](https://docs.rual.nl/block-types/object/object_new_fields) feeds the `object` pin; the `mutations` out pin feeds [get at index](https://docs.rual.nl/block-types/mutations/mutations_get_at_index).

![Studio canvas example for the upsert item to array block: typical wiring for upsert item to array.](https://docs.rual.nl/canvas-examples/mutations_array_upsert.png)

### Version history

Introduced in [`v13.0.4`](https://docs.rual.nl/core-versions/130004).
