---
title: "urlEncode"
canonical: "https://support.appfire.com/space/PSJ/15489224/urlEncode"
format: markdown
---
> Macro (aura-html)


 


|  |  |  |  |
| --- | --- | --- | --- |
| **Syntax** | urlEncode(textToEncode) | **Package** |  |
| **Alias** |  | **Pkg Usage** |  |

## Description

> Macro (excerpt)
> 
> Encodes text in URL format.

Encodes text in URL format. This is useful when constructing a URL address used by a REST command.

## Parameters

| Parameter name | Type | Required | Description |
| --- | --- | --- | --- |
| textToEncode | String | Yes | Text to encode in URL format. |

## Return Type

**String**

Returns the input text URL format

## Example

```javascript
string addon = "power scripts";
string url = "https://marketplace.atlassian.com/search?query=";
string urlText = urlEncode(url + addon);
return urlText;
```

Returns [https://marketplace.atlassian.com/search?query=power%20scripts](https://marketplace.atlassian.com/search?query=power%20scripts)

## See also

> Macro (contentbylabel)