---
title: URL_ENCODE
url: https://www.tines.com/docs/formulas/functions/url-encode/
kind: formula-function
---

*[tines.com](https://www.tines.com/llms.txt) › [Docs](https://www.tines.com/docs/llms.txt) › [Formulas](https://www.tines.com/llm/docs/formulas.md) › [Functions](https://www.tines.com/llm/docs/formulas/functions.md)*

# URL_ENCODE

*[View on tines.com](https://www.tines.com/docs/formulas/functions/url-encode/)*

Converts any URL-unsafe characters in the given text with form or uri encoding. Specify `encoding: "uri"` to use URI encoding, default encoding is form.

**Categories:** Text

## Syntax

```
URL_ENCODE(text, [encoding: "form"])
```

## Examples

### Example 1

Input:

```json
{
  "my_action": {
    "message": "alice@example.com"
  }
}
```

Formula:

```
URL_ENCODE(my_action.message)
```

Output:

```json
"alice%40example.com"
```

### Example 2: Space characters are turned into `+` characters instead of being percent encoded:

Input:

```json
{
  "my_action": {
    "message": "hello world"
  }
}
```

Formula:

```
URL_ENCODE(my_action.message)
```

Output:

```json
"hello+world"
```

### Example 3: % encoding can be enabled via encoding: "uri":

Input:

```json
{
  "my_action": {
    "message": "hello world"
  }
}
```

Formula:

```
URL_ENCODE(my_action.message, encoding: "uri")
```

Output:

```json
"hello%20world"
```

## Sample actions

```json
{
  "standardLibVersion": "14",
  "actionRuntimeVersion": "4",
  "agents": [
    {
      "disabled": false,
      "name": "My Action",
      "description": "",
      "options": {
        "mode": "message_only",
        "loop": false,
        "payload": {
          "message": "alice@example.com"
        }
      },
      "position": {
        "x": 645,
        "y": -2325
      },
      "type": "eventTransformation",
      "timeSavedUnit": "minutes",
      "timeSavedValue": 0,
      "monitorAllEvents": false,
      "monitorFailures": false,
      "monitorNoEventsEmitted": null,
      "form": null
    },
    {
      "disabled": false,
      "name": "URL_ENCODE",
      "description": "",
      "options": {
        "mode": "message_only",
        "loop": false,
        "payload": {
          "url_encode": "=URL_ENCODE(my_action.message)"
        }
      },
      "position": {
        "x": 570,
        "y": -2220
      },
      "type": "eventTransformation",
      "timeSavedUnit": "minutes",
      "timeSavedValue": 0,
      "monitorAllEvents": false,
      "monitorFailures": false,
      "monitorNoEventsEmitted": null,
      "form": null
    },
    {
      "disabled": false,
      "name": "My Action",
      "description": "",
      "options": {
        "mode": "message_only",
        "loop": false,
        "payload": {
          "message": "hello world"
        }
      },
      "position": {
        "x": 480,
        "y": -2325
      },
      "type": "eventTransformation",
      "timeSavedUnit": "minutes",
      "timeSavedValue": 0,
      "monitorAllEvents": false,
      "monitorFailures": false,
      "monitorNoEventsEmitted": null,
      "form": null
    }
  ],
  "links": [
    {
      "sourceIdentifier": 0,
      "receiverIdentifier": 1
    },
    {
      "sourceIdentifier": 2,
      "receiverIdentifier": 1
    }
  ],
  "diagramNotes": []
}
```
