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

# 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/"
}
```
