Can't set integer to null with Feature Service REST update

3992
6
09-07-2012 07:21 AM
by Anonymous User
Not applicable
Original User: oppedahl

I have a feature class published to a 10.1 Feature Service with one of its attributes a nullable integer with no default value defined. I'm trying to edit the attribute with the REST API's Update operation. It works if I set it to a number, but saving null doesn't work. There's no error--the call goes through fine--but the value remains unchanged. Is it not allowed to set a numeric field to null once it's been set to something else? I can set it to null just fine in ArcMap. Here's a snippet of the JSON I'm sending to the update:

[
{
"attributes": {
"OBJECTID_1": 1234,
"AnInt": null,
}
}
]
0 Kudos
6 Replies
by Anonymous User
Not applicable
Original User: miri

Hi Mark,

I have the same problem.
Have you ever got an answer for your question or any workaround?

Thanks a lot,
Miri
0 Kudos
by Anonymous User
Not applicable
Original User: oppedahl

Yes, it's been logged as a bug. See this thread: http://forums.arcgis.com/threads/66425-Can-t-set-integer-to-null-with-Feature-Service-REST-update
0 Kudos
MiriEshel
New Contributor III
Hi Mark,

It's not only integer fields but also string fields.
I hope they will fix it quickly.

Thanks,
Miri
0 Kudos
by Anonymous User
Not applicable
Original User: oppedahl

At least for strings you can set the value to an empty string, which might be OK depending on your application. But there's no alternative for other types like numbers and dates. The bug currently shows a severity of Critical and was last edited on 11/20, for whatever that's worth. 10.1 didn't fix it.
0 Kudos
MiriEshel
New Contributor III
Hi Mark,

There is no problem with empty strings if the field does not have a forein key but if it has (like in my case), it is a problem....

Miri
0 Kudos
AndrewNeuman
New Contributor

My client is working in ESRI Collector and it appears that this issue still occurs. Is this still a known bug?

0 Kudos