---
schema_version: "1"
id: 3f8e8abaf9b22b12c4bfdf18f37779e64a50c506bfec6d174d3246fc50192554
title: toUri
collection: mulesoft
version: current
locale: en-us
portal_url: https://docs.salesforce.com/mulesoft/current/en-us/dataweave/2.6/dw-coercions-functions-touri.md
canonical_url: https://docs.mulesoft.com/dataweave/2.6/dw-coercions-functions-touri
source_site: docs.mulesoft.com
content_type: documentation
content_hash: 1e80f8fdf24efd4ed274637b7d900701d0c722cb49868b80b0c861660ee5989d
description: MuleSoft Documentation Site
release: "2.6"
latest: false
---
---
product: DataWeave
version: 2.6
---

# toUri

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

## toUri(str: String): Uri

Transforms a `String` value into a `Uri` value.

_Introduced in DataWeave version 2.4.0._

### Parameters

<table><colgroup><col> <col></colgroup><thead><tr><th>Name</th><th>Description</th></tr></thead><tbody><tr><td><p><code>str</code></p></td><td><p>The <code>String</code> value to transform into a <code>Uri</code> value.</p></td></tr></tbody></table>

### Example

This example shows how `toUri` behaves.

#### Source

```DataWeave
%dw 2.0
import * from dw::util::Coercions
output application/json
---
{
  toUriExample: toUri("https://www.google.com/")
}
```

#### Output

```DataWeave
{
  "toUriExample": "https://www.google.com/"
}
```
