---
title: setAttributesInBatch
slug: campaign/docs/setattributesinbatch
docTags: 
createdAt: 2026-07-02T19:01:44.226Z
---

This method can be replaced by the .NET replacement method [setAttributesInBatchFlat](docId:4J_rshQ1mfei7NHOxSBIQ).

**Type**: void

**Parameters**

| Name            | Type           | Value                                                                                                                                                                                                                                                                                      |
| --------------- | -------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| sessionId       | String         | ID of the session                                                                                                                                                                                                                                                                          |
| recipientListId | long           | ID of the recipient list                                                                                                                                                                                                                                                                   |
| recipientIds    | String\[ ]     | IDs of the recipients                                                                                                                                                                                                                                                                      |
| attributeNames  | String\[ ]\[ ] | Field names of the fields (e.g., firstname, lastname etc.) that are to be updated                                                                                                                                                                                                          |
| attributeValues | String\[ ]\[ ] | New values for the attributes/fields defined with **attributeNames**<br /><br />Each entry must be formatted according to the [formatting rules](https://world.optimizely.com/documentation/developer-guides/campaign/SOAP-API/introduction-to-the-soap-api/soap-1-1-compatibility/#Type). |

**Return values**

\-

**Code structure**

```java
void setAttributesInBatch(String sessionId, long recipientListId, String[] recipientIds, String[][] attributeNames, String[][] attributeValues)
```
