Loop through JSON response
Trying to consume response from 3rd part RESTApi
I'm successfully getting response however can only get 1st iteration of response. See response below. Anyone willing to share how to loop JSON/Document?
Environment PT 8.54
JSON Response below:
[
{
"city": "Will Rogers",
"county": "Los Angeles",
"state": "CA",
"zip": "90403"
},
{
"city": "Santa Monica",
"county": "Los Angeles",
"state": "CA",
"zip": "90403"
}
]
Sample PeopleCode:
Local string &url;
Local string &jsonString1;
Local Document &DOC;
Local boolean &b_ret;
&url = "https://myserver.com/resttest/pro?";
&url = &url | "zip=" | &Postal;
&str = %IntBroker.ConnectorRequestUrl(&url);
&jsonString1 = &str;
&DOC = CreateDocument("COM", "JSON_GEN", "V1");
&string = &DOC.GenJsonString();
&b_ret = &DOC.ParseJsonString(&jsonString1, False);