Automatically populate customer information from an ID number

jaguiar626's picture

I'm building a form that pulls customer information from our database.  We would like to use the AutoCompleteTextBox component for the 5 digit customer ID.  When the ID is selected, we would like the Customer name and address fields to be automatically populated.  What is the best way to approach this?

stuper's picture

Re: Automatically populate customer information from an ID numbe

Here's the easiest way to do this:

  1. Add a "lookup" link button comp right next to the AutoComplete textbox
  2. The exit path leaves the form, looks up the customer name and address fields, then returns to the form and populates the fields

Here's the harder way to do this:

  1. Open the editor for the AutoComplete textbox and turn on the "Post Form on Value Change" (under functionality tab)
  2. Open the editors of the two display components (for name and address) and set their values to dynamic model.
  3. In the dynamic models, use a variable exists component to check if the ID text box has value. If yes, add your database lookup to retrieve name and address from database.
  4. Map the end comp in the dynamic model to expose the data

This second configuration is harder but it makes it so the user doesn't have to click a button.


jaguiar626's picture

Hey Thanks Stuper,It

Hey Thanks Stuper,

It definately helped point me in the right direction, but with your first option i'm not getting the right return.  In the array return values, i only have options for First and Last.  So what i did was created 2 query components. 1 for just the customer ID's (used in the autocomplete) and the 2nd for customer information (including id number) which is used on the exit path look up.  When i go into the text boxes for name&address I only see the first and last array values. any ideas?
autocomplete.jpg

Dalceon's picture

I have had difficulty in the

I have had difficulty in the past getting textboxes to update without leaving the form and coming back.
The reason you're only getting first and last is probably because a text box can only have a single value and not be an array.
If you want to address the array, you'll have to add that info into another selection form.  If the ID numbers are unique, then
use first or last, they should always bee the same.

If you want the info to change on option 2, you'll probably have to switch the textboxes to labels and store the values somewhere else.

This make sense?

jaguiar626's picture

Thanks Dalceon...  I did get

Thanks Dalceon...  I did get this working using the first option.  i'm going to post a document on how i did it at somepoint this week.