Question

Proper DateTime DataService Syntax

Hello,

I am trying to send some data through DataService to Creatio.

Here is my snippit of the DateTime part,

"CreatedOn": {
				"expressionType": 2,
				"parameter": {
					"dataValueType": 7,
					"value": "2014-01-05 02:03:00.000"
				}
			}

This however does not work, what is the proper format for the value property?

Thanks,

Like 0

Like

5 comments
"items": {
            "CreatedOn": {
                "expressionType": 2,
                "parameter": {
                    "dataValueType": 8,
                    "value": "\"2022-03-03\""
                }
            }
        }

 

keith schmitt,

{
    "responseStatus": {
        "ErrorCode": "JsonReaderException",
        "Message": "Input string '2022-03-03' is not a valid number. Path '', line 1, position 10.",
        "Errors": []
    },
    "rowsAffected": -1,
    "nextPrcElReady": false,
    "success": false
}

This is the response when that is sent.

Tyler Rainey,

I am not sure what you are using, but in python I have to escape the \

 

Phase: {
                        "expressionType": 2,
                        "parameter": {
                        "dataValueType": 8,
                        "value": "\""+ date +"\""
                        }
                    }
                    }

 

If I look at the console when I do an update via browser it looks like this

"items":{"NextActualizationDate":{
"expressionType":2,
"parameter":{
"dataValueType":7,
"value":"\"2022-10-05T18:03:27.020\""

 

Hi,

 

It's easy to test: go to the section or detail that has the DateTime column and try adding or updating data in this column. In my case I was updating the start date and time of an activity:

We need to go to the request payload and see its source:

You can copy the content and go to any JSON beautify service online (like this) to get the readable JSON:

So as we can see the proper DateTime value is:

"StartDate": {
        "expressionType": 2,
        "parameter": {
          "dataValueType": 7,
          "value": "\"2022-10-05T21:00:00.000\""
        }
      },

So you need to specify it in the same way in your DataService request.

Show all comments