Vepraskas

Trying to Create a custom JSON post...

Discussion created by Vepraskas on Jun 4, 2012
Latest reply on Jun 9, 2012 by hzhu
I am building some custom update tools, and am having an issue building the JSON for applyEdits.  I can get the JSON to work if I hard code the attribute values, but If i try to swap in variables it breaks?  What am I missing to use variables in this statement?

Hardcoded Works....
var melding = [{ "attributes": { "OBJECTID": 1010,  "PhotoID_Pic_Num": 55}}];
              
citizenRequestLayer.applyEdits(null,melding, null);



Variable based Fails....
var objectIDVar = 1010;
var photoNum = 55;

var melding = [{ "attributes": { "OBJECTID": objectIDVar,  "PhotoID_Pic_Num": photoNum }}];
              
citizenRequestLayer.applyEdits(null,melding, null);


Any thoughts or suggestions?

Thanks for any guidance, this is driving me nuts!

Outcomes