I am trying to parse this JSON string -
{
"Success": true,
"Messages": [],
"LeadInfo": {
"LeadID": "21941873",
"CapturedDate": "4/29/2015 9:39:33 AM",
"CapturedBy": "Dev Kit 15231929",
"ConnectKey": "1001",
"FirstName": "DEMO_1001",
"LastName": "ATTENDEE_1001",
"Title": "",
"Company": "DEMOCOMPANY_1001",
"Company2": "",
"Address": "145861 N Market Street",
"Address2": "",
"Address3": "",
"City": "Frederick",
"StateCode": "MD",
"ZipCode": "21701",
"CountryCode": "United States",
"Email": "[email protected]",
"Phone": "1234567890",
"PhoneExtension": "1111",
"Fax": "9876543210",
"Notes": ""
},
"Demographics": [
{
"Key": "CATEGORY",
"Description": "Category/Classification",
"Value": "Educator"
},
{
"Key": "SPECIALTY",
"Description": "Specialty",
"Value": "General"
},
{
"Key": "ADDTYPECODE",
"Description": "ADDRESS TYPE",
"Value": ""
}
]
}
I am able to get all of the values using this -
Dim Att: Set Att = JSON.parse(API_Response)
Att.LeadInfo.get("FirstName")
Att.LeadInfo.get("LastName")
This works great.
My issue is how do I get the Values inside the Demographics Piece. What I am trying to get is the value "Educator" from the CATEGORY KEY.
Any ideas?
Demographicsis an array of objects so you would need to loop through them probably with aFor Eachloop. Something likeFor Each demo In att.Demographicsthen you can reference inside the loopdemo.Keyetc.