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

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