ibm mobilefirst - IBM Worklight - How to construct a JSON object in SQL adapter -
to construct json object in sql adapter have tried following:
{ 'patientid':4, 'fname':'test', 'lname':'test', 'age':1, 'dob':1988-09-01, 'gender':'m', 'bg':'a+' } however error:
{ "errors": [ "runtime: method createsqlstatement called inside javascript function." ], "info": [ ], "issuccessful": false, "warnings": [ ] }
first, in "invoke procedure data" window adapter, don't wrap object in quotes. if do, think entire thing string.
if remove beginning , ending quotes have correct. window take valid json objects, if non integers strings. since 1988-09-01 not valid integer, must wrapped in quotes. should able copy/paste object wizard:
{ 'patientid':4, 'fname':'test', 'lname':'test', 'age':1, 'dob':"1988-09-01", 'gender':'m', 'bg':'a+' } 
Comments
Post a Comment