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

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