Lookup UK address from Postcode?

  • 19 September 2016
  • 6 replies
  • 0 views

Userlevel 3
Badge +16

Hi,

 

Me again.

Is it possible to do an address lookup list when a user provides a postcode?

 

I'm using a couple of address textboxes on a form, to make it more user friendly, I want the user to enter their Postcode and then somehow lookup the postal address, is this possible?

 

I'm on Blackpearl v4.6.11

 

Thanks


6 replies

Badge

In the UK TS team, we use a public (paid-for) web service called PCA Predict (was "Postcode Anywhere"). It exposes two SOAP services that you can add as Endpoint Webservice ServiceObjects - the first gives a list of possible addresses from a postcode, the second gives a full address from an ID.

 

So when someone enters a postcode into a text box and clicks "Search", we open up a list subview based on the first service, then when a user double-clicks a list item, the form calls the second service (passing in the ID from the list, obviously),  maps the relevant return fields to the fields in the form and closes the subview.

 

Hope this helps,

 

Tom

Userlevel 3
Badge +16

Thanks Tom,

 

I managed  to hook into a company Web service to do the Post code search and it returns a string which i've linked to a K2 List.

 

Only thing i can't figure out is how to extract the seperate address fields from the STRING.

 

Every row returned from a Postcode search returns One field with a String containing the whole address seperated by commas:

78 k2 Road,K2 Town,County K2,Postcode

 

Can we seperate the List String into seperate fields when Clicked? and take that string and seperate it into Text Boxes on my form for each address part?

 i.e.

Text Box 1 = 78 K2 Road

Text Box 2 = K2 Town

Text Box 3 = County K2

Text Box 4 = Post code

 

???

Thanks as always

Badge +5

Have you tried to use the inline function Split(Text, Seperator) on your string

 

Dave

Userlevel 3
Badge +16

Hi K2 Publisher,

 

Can't use split as it's in K2 Designer, there is no split function in there.

Userlevel 5
Badge +18

I believe for Smartforms, these functions 'split, concatenate, etc.' are exposed when configuring an Expressions for controls:


 


http://help.k2.com/onlinehelp/k2smartforms/userguide/4.6.9/default.htm#sf_-_viewdesigner_layout_-_calculation_expression.html

Userlevel 3
Badge +16

Tin,

 

There is no Split function in Designer for control expressions

Reply