Hi,
I have published a feature service on arcgis server, I am using ajax to push feature to.
I am pushing exactely this data :
var features = [
{
"spatialReference" : {
"wkid" : 2153
},
"geometry" : {"x" : 266687.64720000332 , "y" : 6831744.5318000019},
"attributes" : {
"name_dept": "test dept",
}
}
];
The request result is a success , it returns the record ID.
When I Query the service using the record ID I get the feature but with name_dept=null instead of name_dept = "test dept"
Any Idea ?
Thanks
Hi maxim,
can you please provide the schema of your feature Service? Maybe you created "name_dept" as Integer and not as String-Type...
-
Hi Sir ,
He is the schema of name_dept
name_dept ( type: esriFieldTypeString , alias: name_dept , editable: true , nullable: true , length: 30 )
Hi,
if you send your example as written above, try to remove the comma behind "test dept"
var features = [ {
"spatialReference" : {
"wkid" : 2153
},
"geometry" : {
"x" : 266687.64720000332 ,
"y" : 6831744.5318000019
},
"attributes" : {
"name_dept": "test dept"
}
}];
Can you add the feature correctly by using the rest-interface of your featureservice?
-
I removed the comma but still not working.
It not working neither in the rest interface of arcgis neither in my code.
When I make a post I get the sucess :
{"addResults": [{
"objectId": 133,
"success": true
}]}
But When I query I get :
{
"objectIdFieldName": "objectid",
"globalIdFieldName": "",
"fields": [
{
"name": "name_dept",
"alias": "name_dept",
"type": "esriFieldTypeString",
"length": 30
}
],
"features": [
{
"attributes": {
"name_dept": null
}
}
]
}
So It found the record but does't set the geomtry.
I used ArcMap the view my database , the feature I posted is not inserted in the database.
Hmm,
maybe something with your featureservice isn't set up right. I tried your example using the rest-interface and it worked very well. You can try this, if you want:
Paste this into the Box:
[ {
"spatialReference" : {
"wkid" : 2153
},
"geometry" : {"x" : 266687.64720000332 , "y" : 6831744.5318000019},
"attributes" : {
"CEL": "test dept"
}
}]
You should start getting this work with your service first. Remember that the fieldnames are case-sensitive.
-
Hi Sir,
Exactely some thing is wrong with the feature service I am using .
I just wan to ask you a favor. Can I use your service istead to do my tests ?
I am developping an API for that. So I need to use a Feature Service.
Hi maxim,
unfortunately it is not possible to use this Featureservice for your development. But I can help you creating your own FeatureService in your own Developer subscription, if you want.
-
If That is ok sir, want the service also to return some fields. Because currently no field is returned.
Thanks a Lot.