SinglePoint - Query Address Data
- What is it? In addition to the UPRN and Label of a property you may need to capture some other detail on the property such PAON, SAON, Street, Town, Postcode, County or USRN. This formula can be used to query SinglePoint for that information and save it in the form.
Setup
The formula requires integration with SinglePoint to be configured. This can be done under Settings > Integrations > SinglePoint.
Inputs
This formula has two settings the URPN of the property and the data to return. The return options are:
- Primary Address (PAON)
- Secondary Address (SAON)
- Street
- Town
- Postcode
- County
- USRN
Return values
Value | Description |
---|---|
string | The value of the selected address data |
not-found | If the address data is retrieved from SinglePoint but the requested address data is not set or is empty |
[empty string] | If there is a problem contacting SinglePoint |
Note: return values are case sensitive
Formula Logic
-
A new instance of SinglePointAddressHydrator is created and the method getAddressFromUPRN is called using the UPRN input. If an exception occurs at this point an empty string is returned.
-
If the Return option is Primary Address (PAON) the method getPaon is returned if its value is not empty.
-
If the Return option is Secondary Address (SAON) the method getSaon is returned if its value is not empty.
-
If the Return option is Street the method getStreet is returned if its value is not empty.
-
If the Return option is Town the method getTown is returned if its value is not empty, if it is empty the method getPostTown is returned if its value is not empty.
-
If the Return option is Postcode the method getPostcode is returned if its value is not empty.
-
If the Return option is County the method getAdministrativeArea is returned if its value is not empty.
-
If the Return option is USRN the method getUsrn is returned if its value is not empty.
-
If the formula hasn't already returned not-found is returned.