---
title: getDistinctValues
slug: campaign/docs/getdistinctvalues
createdAt: 2026-07-02T19:01:46.338Z
---

:::hint{type="warning"}
**Caution**
Using this method with the wrong argument (no threshold for instance) can lead to huge amount of data returned.
:::

**Type**: String\[ ]

**Parameters**

| Name              | Type   | Value                                                                                                                                  |
| ----------------- | ------ | -------------------------------------------------------------------------------------------------------------------------------------- |
| sessionId         | String | ID of the session                                                                                                                      |
| recipientListId   | long   | ID of the recipient list                                                                                                               |
| recipientFilterId | long   | ID of the target group                                                                                                                 |
| attributeName     | String | Field name (e.g. firstname, lastname etc.) to be queried for distinct values                                                           |
| threshold         | int    | Number of characters that are examined<br /><br />Example: With a threshold of 4 , the values Test-A and Test-B are summed up to Test. |

**Return values**

Distinct values of the attribute (max. 10,000)

**Code structure**

```java
String[] getDistinctValues(String sessionId, long recipientListId, long recipientFilterId, String attributeName, int threshold)
```
