---
schema_version: "1"
id: 9426dfd1df4446155ec07cc70dbd284efb60d208244e483f45be4aa461cb813a
title: toUri
collection: mulesoft
version: current
locale: en-us
portal_url: https://docs.salesforce.com/mulesoft/current/en-us/dataweave/latest/dw-coercions-functions-touri.md
canonical_url: https://docs.mulesoft.com/dataweave/latest/dw-coercions-functions-touri
source_site: docs.mulesoft.com
content_type: documentation
content_hash: 9896ed9294e3c702d5089e5fdb9825b1a84dee585f7c70e16472db7555235574
description: MuleSoft Documentation Site
release: "2.13"
latest: true
---
---
product: DataWeave
version: 2.13
is-latest-version: true
---

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