---
schema_version: "1"
id: f3dad6876e8d32109c9213cc31aaec7b89258285c10f8189d6e037eee4205b60
title: concatWith
collection: mulesoft
version: current
locale: en-us
portal_url: https://docs.salesforce.com/mulesoft/current/en-us/dataweave/2.6/dw-binaries-functions-concatwith.md
canonical_url: https://docs.mulesoft.com/dataweave/2.6/dw-binaries-functions-concatwith
source_site: docs.mulesoft.com
content_type: documentation
content_hash: d813296dbc8864be390875bb3c1da981d594ff5d65d8246c962260548d4d5c7e
description: MuleSoft Documentation Site
release: "2.6"
latest: false
---
---
product: DataWeave
version: 2.6
---

# concatWith

> For the full documentation index, see: https://docs.mulesoft.com/llms.txt

## concatWith(source: Binary, with: Binary): Binary

Concatenates the content of two binaries.

_Introduced in DataWeave version 2.5.0._

### Parameters

<table><colgroup><col> <col> <col></colgroup><thead><tr><th>Name</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td><p><code>source</code></p></td><td><p>Binary</p></td><td><p>The source binary content.</p></td></tr><tr><td><p><code>with</code></p></td><td><p>Binary</p></td><td><p>The binary to append.</p></td></tr></tbody></table>

### Example

This example concatenates two base-16 values into one binary value.

#### Source

```DataWeave
%dw 2.0
import * from dw::core::Binaries
output application/dw
---
"CAFE" as Binary {base: "16"} concatWith "ABCD" as Binary {base: "16"}
```

#### Output

```Json
"yv6rzQ==" as Binary {base: "64"}
```

## concatWith(source: Binary, with: Null): Binary

Helper function that enables `concatWith` to work with a `null` value.

## concatWith(source: Null, with: Binary): Binary

Helper function that enables `concatWith` to work with a `null` value.
