Autofill-address Tag

Would like an example to consume more data from json result for google map api in ApplicationServices.cs. I would like to create a tag like autofill-address-county and get the county from json response. How can I accomplish this?

Or how to create own tags and overwrite ApplicationServices.cs method?
1 person has
this question
+1
Reply
  • You can access additional information about the completed address by tagging fields with autofill-address-FIELD.

    Supported fields include name, type, latitude, etc. See the the sample address below for the full list of available top-level properties.

    You can also retrieve "components" of the address by tagging fields with autofill-address-ComponentNAME. For example, tag autofill-address-ComponentAdministrativeAreaLevel2Long will give you access to "county" if available:

    The framework returns the address that may look like this:


    {
    "name": "1600 Pennsylvania Ave NW, Washington, DC 20500, USA",
    "address1": "1600 Pennsylvania Ave NW",
    "address2": null,
    "address3": null,
    "city": "Northwest Washington",
    "region": "DC",
    "postalcode": "20500",
    "country": "United States",
    "type": "establishment",
    "latitude": 38.8976763,
    "longitude": -77.0365298,
    "components": {
    "streetnumber": "1600",
    "streetnumberlong": "1600",
    "route": "Pennsylvania Ave NW",
    "routelong": "Pennsylvania Avenue Northwest",
    "neighborhood": "Northwest Washington",
    "neighborhoodlong": "Northwest Washington",
    "locality": "Washington",
    "localitylong": "Washington",
    "administrativearealevel1": "DC",
    "administrativearealevel1long": "District of Columbia",
    "country": "US",
    "countrylong": "United States",
    "postalcode": "20500",
    "postalcodelong": "20500"
    },
    "rawAddress": {
    "address_components": [
    {
    "long_name": "1600",
    "short_name": "1600",
    "types": [ "street_number" ]
    },
    {
    "long_name": "Pennsylvania Avenue Northwest",
    "short_name": "Pennsylvania Ave NW",
    "types": [ "route" ]
    },
    {
    "long_name": "Northwest Washington",
    "short_name": "Northwest Washington",
    "types": [ "neighborhood", "political" ]
    },
    {
    "long_name": "Washington",
    "short_name": "Washington",
    "types": [ "locality", "political" ]
    },
    {
    "long_name": "District of Columbia",
    "short_name": "DC",
    "types": [ "administrative_area_level_1", "political" ]
    },
    {
    "long_name": "United States",
    "short_name": "US",
    "types": [ "country", "political" ]
    },
    {
    "long_name": "20500",
    "short_name": "20500",
    "types": [ "postal_code" ]
    }
    ],
    "formatted_address": "1600 Pennsylvania Ave NW, Washington, DC 20500, USA",
    "geometry": {
    "location": {
    "lat": 38.8976763,
    "lng": -77.0365298
    },
    "location_type": "ROOFTOP",
    "viewport": {
    "northeast": {
    "lat": 38.8990252802915,
    "lng": -77.0351808197085
    },
    "southwest": {
    "lat": 38.8963273197085,
    "lng": -77.0378787802915
    }
    }
    },
    "place_id": "ChIJ37HL3ry3t4kRv3YLbdhpWXE",
    "plus_code": {
    "compound_code": "VXX7+39 Washington, District of Columbia, United States",
    "global_code": "87C4VXX7+39"
    },
    "types": [ "establishment", "point_of_interest" ]
    }
    }
  • (some HTML allowed)
    How does this make you feel?
    Add Image
    I'm

    e.g. kidding, amused, unsure, silly indifferent, undecided, unconcerned sad, anxious, confused, frustrated happy, confident, thankful, excited

  • I’m happy
    That was exactly what I needed. Awesome
  • (some HTML allowed)
    How does this make you feel?
    Add Image
    I'm

    e.g. kidding, amused, unsure, silly indifferent, undecided, unconcerned sad, anxious, confused, frustrated happy, confident, thankful, excited

  • I would like to access the Google Places API

    https://developers.google.com/places/...

    to access information such as

    formatted_phone_number, international_phone_number, opening_hours, website

    I'm looking forward to your reply
  • (some HTML allowed)
    How does this make you feel?
    Add Image
    I'm

    e.g. kidding, amused, unsure, silly indifferent, undecided, unconcerned sad, anxious, confused, frustrated happy, confident, thankful, excited

  • Big Data,

    If you have the full version of Unlimited Edition, then override the Process method in the AutoFillAddress partial class. It returns the address that includes the Place ID. You can query google API further to get the phone number and other properties as explained at https://developers.google.com/places/....

    If you need help getting this integrated then open a support ticket and request a custom implementation quote.

    Here is the response for Code On Time address. The place ID is at the bottom of the JSON object.

    [
    {
    "name": "11440 W Bernardo Ct #300, San Diego, CA 92127, USA",
    "address1": "11440 W Bernardo Ct #300",
    "address2": null,
    "address3": null,
    "city": "Rancho Bernardo",
    "region": "CA",
    "postalcode": "92127",
    "country": "United States",
    "type": "subpremise",
    "latitude": 33.0223099,
    "longitude": -117.0828185,
    "components": {
    "subpremise": "300",
    "subpremiselong": "300",
    "streetnumber": "11440",
    "streetnumberlong": "11440",
    "route": "W Bernardo Ct",
    "routelong": "West Bernardo Court",
    "neighborhood": "Rancho Bernardo",
    "neighborhoodlong": "Rancho Bernardo",
    "locality": "San Diego",
    "localitylong": "San Diego",
    "administrativearealevel2": "San Diego County",
    "administrativearealevel2long": "San Diego County",
    "administrativearealevel1": "CA",
    "administrativearealevel1long": "California",
    "country": "US",
    "countrylong": "United States",
    "postalcode": "92127",
    "postalcodelong": "92127"
    },
    "rawAddress": {
    "address_components": [
    {
    "long_name": "300",
    "short_name": "300",
    "types": [
    "subpremise"
    ]
    },
    {
    "long_name": "11440",
    "short_name": "11440",
    "types": [
    "street_number"
    ]
    },
    {
    "long_name": "West Bernardo Court",
    "short_name": "W Bernardo Ct",
    "types": [
    "route"
    ]
    },
    {
    "long_name": "Rancho Bernardo",
    "short_name": "Rancho Bernardo",
    "types": [
    "neighborhood",
    "political"
    ]
    },
    {
    "long_name": "San Diego",
    "short_name": "San Diego",
    "types": [
    "locality",
    "political"
    ]
    },
    {
    "long_name": "San Diego County",
    "short_name": "San Diego County",
    "types": [
    "administrative_area_level_2",
    "political"
    ]
    },
    {
    "long_name": "California",
    "short_name": "CA",
    "types": [
    "administrative_area_level_1",
    "political"
    ]
    },
    {
    "long_name": "United States",
    "short_name": "US",
    "types": [
    "country",
    "political"
    ]
    },
    {
    "long_name": "92127",
    "short_name": "92127",
    "types": [
    "postal_code"
    ]
    }
    ],
    "formatted_address": "11440 W Bernardo Ct #300, San Diego, CA 92127, USA",
    "geometry": {
    "bounds": {
    "northeast": {
    "lat": 33.0228578,
    "lng": -117.082392
    },
    "southwest": {
    "lat": 33.0217335,
    "lng": -117.0831833
    }
    },
    "location": {
    "lat": 33.0223099,
    "lng": -117.0828185
    },
    "location_type": "ROOFTOP",
    "viewport": {
    "northeast": {
    "lat": 33.023644630291493,
    "lng": -117.0814386697085
    },
    "southwest": {
    "lat": 33.0209466697085,
    "lng": -117.0841366302915
    }
    }
    },
    "place_id": "EjIxMTQ0MCBXIEJlcm5hcmRvIEN0ICMzMDAsIFNhbiBEaWVnbywgQ0EgOTIxMjcsIFVTQSIfGh0KFgoUChIJHXIhrSv324AR6BDj3e0Qzr4SAzMwMA",
    "types": [
    "subpremise"
    ]
    }
    }
    ]
  • (some HTML allowed)
    How does this make you feel?
    Add Image
    I'm

    e.g. kidding, amused, unsure, silly indifferent, undecided, unconcerned sad, anxious, confused, frustrated happy, confident, thankful, excited