Drupal Association members fund grants that make connections all over the world.
The Feeds module may be used to import Address Field data into entities containing address fields. Address Field stores the individual elements of an address separately (e.g. city, state, postal code), so your data source must differentiate these parts of the address using separate columns or elements.
When configuring your mapper, Feeds lets you select which part of the address field the data source maps to:
There are four important things to keep in mind with respect to address field data:
- When importing address data, you should always supply a country value. If your data source does not include a country (whether it's because all addresses come from the same country or some items in the data source have a country while others do not), you should use a module like Feeds Tamper to supply a default value. Address Field currently depends on the country to know if a field value is empty and to know how to build the address field widget form.
- Address Field identifies countries using their two character ISO 3166-1 country codes. If your source data uses the full name, you will need to change the way you create your source data or use custom code (perhaps working through Feeds Tamper) to convert the full country name into the corresponding country code.
- Address Field identifies administrative areas (i.e. State / Province) using their alphanumeric ISO 3166-2 codes for any country whose address field widget form uses a select list instead of a textfield to specify the administrative area. As above, if your source data uses the full name, you will need to convert the data for import. Address Field does not yet have a solid API for converting one to another, but interested developers can follow this related issue to be updated when it adds one.
- To import a separate house number (e.g. for postal code validation or lookup): map the number to the Address Data field; use Tamper to rewrite the value with
For more information on configuring a Feeds importer, refer to the Feeds site builder documentation.