> For the complete documentation index, see [llms.txt](https://docs.no-reducer.com/no-reducer/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.no-reducer.com/no-reducer/no-reducer-actions/replace/replace-with-condition.md).

# replace with condition

To replace an item object in an array of objects, you can write the value key of the object you want to replace.

```javascript
dispatch(replace('DESTINATION',CONDITION-VALUE,CONDITION-KEY))
```

**Example**: Replace User with `id = 1` in `Users`

```javascript
dispatch(replace('Users', { name: "Crawfish" }, 1, 'id'))
```

<figure><img src="https://2096029297-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fa8hQdsN7Pv00B1Pt9tuc%2Fuploads%2Fbiyla8YBdhC2aP1yMluQ%2F68747470733a2f2f766e73656174746c652e636f6d2f64796e616d6963526564756365722f7265706c6163654f626a6563742e706e67.png?alt=media&amp;token=013d42a5-811d-4528-bc7a-8c0ee1c97863" alt=""><figcaption></figcaption></figure>

<br>

\ <br>
