update field with null

4909
3
08-12-2014 08:19 AM
CesarRevilla
New Contributor III

The REST API (10.1) ignores the null updates.

Here the update string:


[
{

     "geometry":null,

     "attributes":{

        "OBJECTID":683,

        "STATUS_ID":"371f2a16",

        "LOAD":0,

        "VALUE":null,

        "DESC":""}

}]

 

VALUE is nullable and before the update VALUE is equals 20.

 

After a successful update VALUE is still 20.

 

(The FeatureLayr.Fields[Field].nullable is setted to true and the Geodatabase is connected through SDE.)

 

Does anyone know a solution to set a <null> in VALUE?

 

Regards

0 Kudos
3 Replies
CesarRevilla
New Contributor III

is this a replicable Problem? or is only a problem in my Rest Server and my Database?

0 Kudos
GreggCornetski
New Contributor III

Did you find the solution? There is barely any mention of this issue in the forums. In Flex API forum is a post of the same problem. ESRI response says it will be fixed in the next release(?) and mentions a workaround of setting the value to Number.NaN. I don't know to what that translates in the JSON update string. It would be odd for the Server REST API to know how to handle "VALUE":NaN (???), but not know how to handle the typical "VALUE":null.

CesarRevilla
New Contributor III

Hi Gregg, Esri fixed this problem in ArcGIS Server 10.3 (im not sure about 10.2). In the current Version you can write (insert) "null" in REST and its accepted as NULL in the geodatabase.

NaN is not the same as NULL, you can use the String "NaN" in the ReST Service (ArcGIS Server 10.?, im not sure about since) to write a Not a Number in the DB-Field. This is a good workarround for some cases.

Regards

0 Kudos