0
votes

I have a logic app which gets Address info using Bind Rest Api. I received a nested json object. When I tried to parse it, I'm getting null values in dynamix syntax box.

Below is the json object that I get, however when I use these as properties after parsing, they are marked as null:

{
    "address": {
            "addressLine": "1-11-252, Begumpet Road",
            "adminDistrict": "TS",
            "adminDistrict2": "Hyderabad",
            "countryRegion": "India",
            "formattedAddress": "1-11-252, Begumpet Road, Hyderabad, TS 500016",
            "intersection": {
                "baseStreet": "Begumpet Road",
                "secondaryStreet1": "Chikoti Garden No-4 Road",
                "intersectionType": "Near",
                "displayName": "Begumpet Road and Chikoti Garden No-4 Road"
            },
            "locality": "Hyderabad",
            "neighborhood": "Begumpet",
            "postalCode": "500016",
            "countryRegionIso2": "IN"
    }
}

Image 1

Image 2

Image 3

1

1 Answers

0
votes

Based on your information, here's what I did:

  1. Created a Logic App in the Azure portal
  2. Selected the "When a HTTP request is received" trigger
  3. Clicked "Use sample payload to generate schema" link and pasted your example data (SEE BELOW!)
  4. Added a "Response" action
  5. Defined the response's body to be:
{
    "address": baseStreet
}

Where baseStreet is a reference to the baseStreet dynamic content.

The result:
The resulting Logic App

IMPORTANT!
Please be advised that the Request Body JSON Schema is different than the payload:

{
    "type": "object",
    "properties": {
        "address": {
            "type": "object",
            "properties": {
                "addressLine": {
                    "type": "string"
                },
                "adminDistrict": {
                    "type": "string"
                },
                "adminDistrict2": {
                    "type": "string"
                },
                "countryRegion": {
                    "type": "string"
                },
                "formattedAddress": {
                    "type": "string"
                },
                "intersection": {
                    "type": "object",
                    "properties": {
                        "baseStreet": {
                            "type": "string"
                        },
                        "secondaryStreet1": {
                            "type": "string"
                        },
                        "intersectionType": {
                            "type": "string"
                        },
                        "displayName": {
                            "type": "string"
                        }
                    }
                },
                "locality": {
                    "type": "string"
                },
                "neighborhood": {
                    "type": "string"
                },
                "postalCode": {
                    "type": "string"
                },
                "countryRegionIso2": {
                    "type": "string"
                }
            }
        }
    }
}

When running with the Parse JSON step:
Parse JSON