I am trying to extract address data from a Google People API call within Podio Workflow Automation. I am successfully extracting all other data except the address.
The situation - if I request names only, I can extract each of the separate name fields, but if I add addresses into the request, I can no longer extract the name fields, or the address fields. If I request only address, i cannot extract address fields.
For some reason including the address data seems to break the JSON..
Request for name data only and I get:
{
"resourceName": "people/c2138163302931177819",
"etag": "%EgUBAi43PRoEAQIFByIMT1hSSUpZWTVuMFk9",
"names": [
{
"metadata": {
"primary": true,
"source": {
"type": "CONTACT",
"id": "1dac48320efd215b"
}
},
"displayName": "xx xxxxx xxxxxx",
"familyName": "xxxxxx",
"givenName": "xxxxx",
"honorificPrefix": "xx",
"displayNameLastFirst": "xxxxxx, xx xxxxx",
"unstructuredName": "xx xxxxx xxxxxx"
}
]
}
Request for name and address data and I get:
{
"resourceName": "people/c2138163302931177819",
"etag": "%EggBAgwQLjc9QBoEAQIFByIMT1hSSUpZWTVuMFk9",
"names": [
{
"metadata": {
"primary": true,
"source": {
"type": "CONTACT",
"id": "1dac48320efd215b"
}
},
"displayName": "xx xxxxx xxxxxx",
"familyName": "xxxxxx",
"givenName": "xxxxx",
"honorificPrefix": "xx",
"displayNameLastFirst": "xxxxxx, xx xxxxxx",
"unstructuredName": "xx xxxxx xxxxxx"
}
],
"addresses": [
{
"metadata": {
"primary": true,
"source": {
"type": "CONTACT",
"id": "1dac48320efd215b"
}
},
"formattedValue": "xxxxxxx\nSouthampton, England xxxxxxx\nUnited Kingdom",
"streetAddress": "xxxxxxx",
"city": "Southampton",
"region": "England",
"postalCode": "xxxxxxx",
"country": "United Kingdom",
"countryCode": "GB"
}
]
}
For me this looks no different in structure, however when I've changed it to code on here it's not recognising the latter one correctly..
In Podio I am base64 encoding the response and then as an example to extract first name I use:
json_decode(base64_decode([(Variable) google_array]))->{'names'}[0]->{'givenName'}
For City I'm using
json_decode(base64_decode([(Variable) google_array]))->{'addresses'}[0]->{'city'}
Extracting the name works fine if I only request name details, but not if it includes address details as well. It is only address that seems to create this problem. I cannot extract any address details.