Address data type |
The data type Address represents a complete address and geographic location and is made up of the subfields described below. When you work with columns that have the Address data type, you have the option to either work with the full address as a string or with the individual subfields that make up an address.
When an address data type is created, it will try to fill out all of the details of the address and geographic location that were not explicitly provided by using the data that was provided and the following geocoding rules:
To provide the address as a string within an input template, use the format shown below. If you do not include a country in your address input ("address[ -- country]"), then the country defaults to USA.
"3110 Esperanza Crossing, Austin, TX 78741"
"2000 Airport Rd NE Calgary, AB T2E 6Z8 -- Canada"
"11 Albert Street, Richmond, VIC 3121 -- Australia"
Instead of inputting or outputting the full address as a string, you also have the option to work with the individual subfields that make up an address (for example, Address.City). For more information about working with subfields, see Accessing subfields.
The Address data type contains the following subfields:
Subfield | Data Type | Description |
---|---|---|
StreetNumber | Text | The street number portion of the address. |
StreetName | Text | The street name portion of the address. |
City | Text | The city portion of the address. |
Suburb | Text | The suburb in which the address is located, if applicable. |
Region | Text | The state or region portion of the address. |
PostalCode | Text | The postal code or zip code portion of the address. |
Country | Text | The country portion of the address. |
Coordinates | Location | The lat and lon location for the address. Lat and lon can also be accessed as subfields (for example, Address.Coordinates.Lat). |
Label | Text | The type label for the address. The label is displayed when listing addresses in Fleet (for example, "Physical", "Postal", or "P.O. Box"). |
In the [Script] section, an Address data type maps to a custom Address object. This is subject to the Address geocoding rules described above. If a geocode operation fails, Coordinates.Lat and Coordinates.Lon are set to 0.
new AddressData({Address: "20 Enterprise, Aliso Viejo, CA, 92656", Country:"USA"})
new AddressData({Coordinates: {Lat: 33.58436, Lon:-117.73097}})
You can access these address elements as fields:
.StreetNumber
.StreetName
.City
.Suburb
.Region
.PostalCode
.Country
.Coordinates
.Label