---
title: External data
slug: campaign/docs/external-data
docTags: 
createdAt: 2026-07-20T15:45:29.638Z
---

This topic describes how to process external data using field functions.

:::hint{type="info"}
**Note**

Use your specific data and recipient list fields, and test the field functions before using them in a mailing.
:::

## Displaying a JSON string as text in a mailing

If you retrieve data via API and store it as a JSON string, you can display the content as text with the following velocity code:

```velocity
#set ($jsonContent = $json.readFromString(${jsonString}))
```

If recipient list fields contain data as JSON, you can display the content as text using the following velocity code:

```velocity
#set ($jsonContent = $json.readFromString($!{user.data.RECIPIENTLISTFIELD}))
```

### Example

You have a recipient list with a *custom* field in text format that contains the following JSON string:

`{"clearname": "John Smith", "unsubscribelink": "http://www.example.com/unsubscribe/user-id-1234"}`

In the mailing, you can use the JSON string using velocity code as follows:

```velocity
#set ($jsonContent = $json.readFromString($!{user.data.custom}))Hello ${jsonContent.clearname}! To unsubscribe from the newsletter, click <a href="${jsonContent.unsubscribelink}">here</a>.
```

## Displaying post-click data

Velocity lets you access the following [post-click](docId\:jUFEVph0D8Uog1OGwLVgu) data and display it in a mailing:

- service ("name\_of\_service")
- stringValue("x")
  - is()
  - isNot()
- floatValue("X")
  - isGreaterThan("y")
  - isLessThan("y")
  - isGreaterThanOrEqualTo("y")
  - isLessThanOrEqualTo("y")

:::hint{type="info"}
**Tip**

Using velocity field functions, you can display only the most recent post-click data. You cannot display older data.
:::

### Example

The following Velocity code lets you display the value of *gvalue10* in the *serviceName* service:

```velocity
#set($strGvalue = $!postClick.find().where().service().is("serviceName").getStringResult(10))$strGvalue
```
