---
title: setAttributesByFilter
slug: campaign-dev-docs/setattributesbyfilter
createdAt: 2026-07-02T19:01:46.737Z
---

**Type**: void

**Parameters**

| Name              | Type       | Value                                                                                                                                                                                                              |
| ----------------- | ---------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| sessionId         | String     | ID of the session                                                                                                                                                                                                  |
| recipientListId   | long       | ID of the recipient list                                                                                                                                                                                           |
| recipientFilterId | long       | ID of the recipient                                                                                                                                                                                                |
| attributeNames    | String\[ ] | Names of the fields (e.g. firstname, lastname etc.) to be updated                                                                                                                                                  |
| attributeValues   | String\[ ] | New values for the attributes/fields defined with **attributeNames**.<br />Each entry must be formatted according to the [formatting rules](https://docs.optimizely.com/campaign-dev-docs/soap-1-1-compatibility). |
| mode              | String     | For fields of the type String this parameter can be set to:<br /><br /><br /><br />set (overwrite)<br /><br /><br />prepend<br /><br /><br />append<br /><br />For all other types the value is set by default.    |

**Return values**

- **Code structure**

```javascript
void setAttributesByFilter(String sessionId, long recipientListId, long recipientFilterId, String[] attributeNames, String[] attributeValues, String mode)
```
