AnsweredAssumed Answered

Filter list of values - Choose Description but code sent to database

Question asked by ionarawilson on Jul 2, 2013
Latest reply on Jul 8, 2013 by myn@bjtu
I am a newbie to Python but eager to learn. I need to create tools in ArcMap to enter and edit data. Users will need to enter for example the name of the office they work, so I created domains for that. So let's say the user completed a task in Alpine, then he would enter Alpine in the drop-down box. So for each office there is a domain. For example:

Code   Description

AL       Alpine
AU      Austin
CA      Carthage

And so on...

The problem is that I need the user to see the description in the dropdown box but the code to be sent to the database when he chooses an office name. So for example he would choose Austin, but the database would record AU in the office field.

The way it is now, when I create the parameters using the out-of-the-box properties of the script, I have to use the Filter and enter a value list. However,  if I use the description value in the list of values (which is want I want) , this description will be recorded in the table. For example if the user chooses Austin, Austin would be recorded in the database, instead of AU. Is there a way to change this? I was reading about tool validators but I have no idea how to use it. Thank you for any help you can provide!