What is wrong in my Cellsets command?

I’m issuing the following REST request to the server:

PATCH http://win5778-eappl:19503/api/v1/Cellsets(‘33SHq2sYAIAGAAAg’)/Cells HTTP/1.1

Payload:

[{ "Ordinal": 0, "Value": "0"}, { "Ordinal": 1, "Value": "1"}, { "Ordinal": 2, "Value": "2"}]

Response from server:

{"error":{"code":"","message":"SystemValueInvalid"}}

So what is wrong?

Hi @Roland,

Any particular reason why you would go through the above?

If you are looking for ways to save multiple values into TM1, there is an existing function in $tm1Ui that can help you on this already:

$tm1Ui.cellsetPut(cellPutRequests);

Here is an example:

var cellPutRequests = [
  {value:'2017', instance:'dev', cube:'System Info', cubeElements:['Financial Year', 'String']}
  , {value:'2017', instance:'dev', cube:'System Info', cubeElements:['Budget Base Year', 'String']}
];

$tm1Ui.cellsetPut(cellPutRequests).then(function(result){
  if(result.success){
     // successfully saved - do more
  }
});


Paul

Hi @plim I’m calling this from Java, not javascript.

Did you try to run this in Postman?

Check the Cellset and make sure there are those three cells you are trying to update.
GET /api/v1/Cellsets(‘33SHq2sYAIAGAAAg’)/Cells

The problem was that in the MDX used to select the cellset I didn’t define a ROWS axis and instead put the ROWS expression in the WHERE clause. You need to have COLUMNS and ROWS in the MDX that requests the CellSet.

SELECT 
    XXX ON COLUMNS,
    XYZ ON ROWS
    FROM CUBE
    WHERE ...
1 Like