The issue I’m running into is that the JSON is the same key value, but it structures its response differently depending on what I send it. When the address is found it returns a single set of values. When the address is not found it returns an array (list) of sets of values. Bubble can’t tell the difference. When I try typing in the key twice with each structure it just treats it like a list and doesn’t import single value (correct address) responses.
When the address is correct.
{
"XAVResponse": {
"Response": {
"ResponseStatus": {
"Code": "1",
"Description": "Success"
},
"TransactionReference": {
"CustomerContext": "Your Customer Context"
}
},
"ValidAddressIndicator": "",
"Candidate": {
"AddressKeyFormat": {
"AddressLine": "12380 MORRIS RD",
"PoliticalDivision2": "ALPHARETTA",
"PoliticalDivision1": "GA",
"PostcodePrimaryLow": "30005",
"PostcodeExtendedLow": "4616",
"Region": "ALPHARETTA GA 30005-4616",
"CountryCode": "US"
}
}
}
.
.
When the address is incorrect: Returns an array.
{
"XAVResponse": {
"Response": {
"ResponseStatus": {
"Code": "1",
"Description": "Success"
},
"TransactionReference": {
"CustomerContext": "Your Customer Context"
}
},
"AmbiguousAddressIndicator": "",
"Candidate": [{
"AddressKeyFormat": {
"AddressLine": "27-35 SOUTH RD",
"PoliticalDivision2": "Beverly Hills",
"PoliticalDivision1": "CA",
"PostcodePrimaryLow": "90210",
"PostcodeExtendedLow": "2727",
"Region": "Beverly Hills MA 90210-2727",
"CountryCode": "US"
}
},
{
"AddressKeyFormat": {
"AddressLine": "30-36 SOUTH RD",
"PoliticalDivision2": "Beverly Hills",
"PoliticalDivision1": "CA",
"PostcodePrimaryLow": "90210",
"PostcodeExtendedLow": "2739",
"Region": "Beverly Hills MA 90210-2739",
"CountryCode": "US"
}
},
{
"AddressKeyFormat": {
"AddressLine": "37-47 SOUTH RD",
"PoliticalDivision2": "Beverly Hills",
"PoliticalDivision1": "CA",
"PostcodePrimaryLow": "90210",
"PostcodeExtendedLow": "2716",
"Region": "Beverly Hills MA 90210-2716",
"CountryCode": "US"
}
},
{
"AddressKeyFormat": {
"AddressLine": "38-58 SOUTH RD",
"PoliticalDivision2": "Beverly Hills",
"PoliticalDivision1": "CA",
"PostcodePrimaryLow": "90210",
"PostcodeExtendedLow": "2732",
"Region": "Beverly Hills MA 90210-2732",
"CountryCode": "US"
}
},
{
"AddressKeyFormat": {
"AddressLine": "49-57 SOUTH RD",
"PoliticalDivision2": "Beverly Hills",
"PoliticalDivision1": "CA",
"PostcodePrimaryLow": "90210",
"PostcodeExtendedLow": "2725",
"Region": "Beverly Hills MA 90210-2725",
"CountryCode": "US"
}
},
{
"AddressKeyFormat": {
"AddressLine": "59-77 SOUTH RD",
"PoliticalDivision2": "Beverly Hills",
"PoliticalDivision1": "CA",
"PostcodePrimaryLow": "90210",
"PostcodeExtendedLow": "27ND",
"Region": "Beverly Hills MA 90210-27ND",
"CountryCode": "US"
}
},
{
"AddressKeyFormat": {
"AddressLine": "60-62 SOUTH RD",
"PoliticalDivision2": "Beverly Hills",
"PoliticalDivision1": "CA",
"PostcodePrimaryLow": "90210",
"PostcodeExtendedLow": "2736",
"Region": "Beverly Hills MA 90210-2736",
"CountryCode": "US"
}
},
{
"AddressKeyFormat": {
"AddressLine": "64-98 SOUTH RD",
"PoliticalDivision2": "Beverly Hills",
"PoliticalDivision1": "CA",
"PostcodePrimaryLow": "90210",
"PostcodeExtendedLow": "2737",
"Region": "Beverly Hills MA 90210-2737",
"CountryCode": "US"
}
},
{
"AddressKeyFormat": {
"AddressLine": "79-99 SOUTH RD",
"PoliticalDivision2": "Beverly Hills",
"PoliticalDivision1": "CA",
"PostcodePrimaryLow": "90210",
"PostcodeExtendedLow": "27ND",
"Region": "Beverly Hills MA 90210-27ND",
"CountryCode": "US"
}
}
]
}
}