---
category: [Administration & Integrations, Platform and Product Extensions, Platform and Product Extensions/Integration, Administration & Integrations/Custom Integrations & Apps, Platform and Product Extensions/Workday Extend]
keyword: [Extend, PMD Scripting, Scripts]
nav: wcp_docs
parent_url: /wcp_docs/
title: pathEncode ( )
layout: subsection
---

## <a id="section_m3p_myb_5db"></a>Description

Encodes the given URL path as a standard UTF-8 encoded URL. Use `pathEncode` to encode:

-   Parameters or segments within the URL path.
-   WQL queries.


To encode query parameter names and values within a URL, use `urlEncode`.

## <a id="section_cyq_j1m_zsb"></a>Return Type

`String`

## <a id="section_dz5_pwg_5db"></a>Instance Method Syntax

```
thisString.pathEncode()
```

<b>Example</b>

`'data?query= SELECT supplier FROM suppliers WHERE isContingentWorker = false'.pathEncode()`

Returns `data?query=%20SELECT%20supplier%20FROM%20suppliers%20WHERE%20isContingentWorker%20=%20false`

## <a id="section_dz5_pwg_5d"></a>Namespace Function Syntax

```
string:pathEncode(urlPath)
```

<table><thead><tr><th>Parameter</th><th>Description</th></tr></thead><tbody><tr><td>urlPath</td><td>A string containing path parameters or path segments with escaped characters.</td></tr></tbody></table><br/>

<b>Example</b>

`string:pathEncode('/myPath/\" \"/endOfPath')`

Returns `'/myPath/%22%20%22/endOfPath'`

### Related Information

[urlEncode ( )](/wcp_docs/fhz1526275637049.html)

