I hope you can help
I have the following code which works fine for the first level of fields, how do i get the data for the address1 address2 city and postcode
// json return string is
{
"id": "W2DBZqIkce",
"id": "W2DBZqIkce",
"status": "active",
"type": "customer",
"ref": "",
"firstname": "Bob",
"lastname": "Baker",
"email": "bbaker@myemail",
"mobile": "012345678",
"address": {
"address1": "9 My Address",
"address2": "Town",
"city": "London",
"postcode": "W1 3PA"
},
"dateCreated": "2018-02-21 15:02:57"
}
"address": {
"address1": "9 My Address",
"address2": "Town",
"city": "London",
"postcode": "W1 3PA"
},
"dateCreated": "2018-02-21 15:02:57"
}
// powerbuilder code
JSONParser json
json = create JSONParser
ls_result = json.loadstring( ls_string )
ll_root = json.getrootitem( )
ls_id = json.getitemstring( ll_root, "id" )
ls_status = json.getitemstring( ll_root, "status" )
ls_type = json.getitemstring( ll_root, "type" )
ls_ref = json.getitemstring( ll_root, "ref")
ls_firstname = json.getitemstring( ll_root, "firstname")
ls_lastname = json.getitemstring( ll_root, "lastname")
ls_email = json.getitemstring( ll_root, "email")
ls_mobile = json.getitemstring( ll_root, "mobile")
thanks in advance as always
Andrew