What is wrong in my Cellsets command?

tm1

#1

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?


#2

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


#3

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


#4

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


#5

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 ...