I have gone through many posts on finding Value from Complex Array, but all of those only fetch up to second level. Can someone please provide me with code to recursively find the value for example state in address_line_2 whether exists or not?
I have the following JSON
{
"company": {
"id": "123456",
"name": "Test Company LLC.",
"FEIN": "22-2222222",
"address": {
"address_line_1": {
"street": "1 Street St, Suite 12",
"city": "San Francisco",
"postalCode": "123456"
},
"address_line_2": {
"state": "CA",
"country": "USA"
}
},
"phone": "1-800-XXX-XXXX",
"fax": "1-800-XXX-XXXX",
"email": "admin@abc.com",
"URL": "www.abc.com"
},
"producer": {
"id": "LLXXXX",
"name": "Test Name",
"phone": "555-555-5555",
"mobile": "555-555-5555",
"fax": "555-555-5555",
"email": "test@abc.com",
"producerSubCode": "111",
"NIPRId": "123456",
"stateProducerId": "12344"
}
}
~Harshit