Get up and running with Address Capture quickly using our SDK.
{PostalCode}
.
Any regular text or HTML can be included in the template strings around the field values, such as <b>{Line1}</b>, {Line2}
.
Conditional formatting can be added by enclosing the field, and any additional text which is conditional on the field having a value, in a second set of curly brackets. If the template string was {Line1}{, {Line2}}
then the comma would not appear unless the selected address had a second address line.
Finally, field values will always appear in title case, but can easily be capitalised by adding an exclamation mark (!) at the end of the field name, like this {City!}
.
Event | What it means |
---|---|
load | The control is now ready. It has finished adding elements to the page and is now listening to page events. |
show | The control is now visible on the page. |
hide | The control has been hidden. |
search | The user is searching. You can modify the searchTerm and lastId of the search object (parameter 1) at this stage. |
results | Results have been returned from the find service. You can modify the list of suggestions returned (parameter 1) and access the extended attributes object (parameter 2) including properties such as ContainerCount. |
noresults | No matching results were returned from the find service. |
display | The suggestions have been shown to the user. |
select | The user has selected a suggestion. The chosen suggestion can be accessed (parameter 1). |
prepopulate | The full address has been returned from the retrieve service. The address object (parameter 1) can be accessed and modified before fields are populated, as well as full list of language variations (parameter 2) for the address. |
populate | The address fields have been populated. This is the most common event to listen for, and will allow you to populate your own fields with your own logic using the address object (parameter 1) and the list of address variations (parameter 2). |
country | The country has been changed. The selected country object (parameter 1) with iso2, iso3 and name properties is passed through. |
manual | When the manualEntry option is passed through and the user selects the option to enter their address manually this event will fire. |
error | An error has occured. The error message (parameter 1) is passed through. Typically errors are not shown to the user, but can be handled manually here if needed. |
The control is loading before the fields have been rendered
There is an error somewhere on the page
Account or key settings
The control doesn't update my React form
{Latitude}
and {Longitude}
. Royal Mail PAF contains postcode level coordinate information.