Module cell data requests are mainly used to update cell values directly in a module, rather than using a file-based import.
This endpoint provides targeted, transactional write access to module cell data. You use it to determine if it is possible to update specific cells in an Anaplan module directly.
Ensure the request body is an array of CellWrite objects (see below). Each object is for an updated individual cell and its full set of dimensions.
The response contains a summary of the number of cells updated successfully and the details of why some cells that could not be updated.
Notes:
- Ensure the user has write access enabled.
- Ensure the request includes all of the required fields.
- Ensure the request has a
valuefield that is either a string, number or boolean and is compatible with the line item format/data type. - If one cell cannot update, the other cells in the request still continue to update.
- To use this call, you must be a Workspace Administrator.
- Workspace administrators can import data into any cell (except aggregate cells, see below), including read-only and invisible cells.
- You can update a maximum of 100,000 cells or 15 MB of data (whichever is lower), in a single API call. For larger scale payloads, we recommend you use the import API.
- Write cell data does not apply to aggregate cells.
- An aggregate cell is a cell where one of its dimension items has it’s own child items
- This includes aggregate cells for line Items with breakback enabled
- For a line Item that is dimensioned by a composite list, the only writeable cells are the child items, that are defined directly in the dimension list and not defined in a parent list.
The CellWrite Object
Each CellWrite Object is a request to set a value in a cell. A cell is identified by the line item it belongs to as well as an item for each of the dimensions that apply to the line item (this includes Time and Versions).
This table details the fields that are in a cell write object:
| Field | Details |
lineItemId |
|
lineItemName |
|
dimensions |
|
dimensionId |
|
dimensionName |
|
itemId |
|
itemName |
|
itemCode |
|
value |
|
Line Item Values
There are multiple formats for line items. Ensure the value specified in the value field aligns with the line item format. Below is a table of the different line item formats we support and examples of values you can use:
| Line Item Format | Details |
Number |
|
Text |
|
Boolean |
|
Date |
|
Time Period for example, Week, Month, Quarter, Half-Year or Year |
|
List (list-formatted Line Item) |
|
For more information on Javascript primitive types see:
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures
Method and endpoint
/models/{modelId}/modules/{moduleId}/data
Parameters
| Parameter | Details |
{workspaceId} |
|
{modelId} |
|
{dimensionId} |
|
Curl example
curl -X POST 'https://api.anaplan.com/2/0/models/{modelId}/modules/{moduleId}/data' \
-H 'Authorization: AnaplanAuthToken {anaplan_auth_token}'\
-H 'Accept: application/json'
-H 'Content-Type: application/json'
--data-raw '<see_below>'
Response
A successful response is in Content-Type: application/json format:
{
"meta": {
"schema": "https://api.anaplan.com/2/0/objects/writeCellDataResponse"
},
"status": {
"code": 200,
"message": "Success"
},
"numberOfCellsChanged": 42,
"failures": [
{
"requestIndex": 0,
"failureType": "cellIsCalculated",
"failureMessageDetails": "the cell is a calculated/aggregate cell and is not writeable"
},
{
"requestIndex": 9,
"failureType": "cellIsInvalid",
"failureMessageDetails": "the cell could not be found or resolved"
}
]
}