Populate one field based on another, using a lookup list?

6614
9
11-10-2010 04:57 AM
AndyMorgan
New Contributor
I have two fields in a geodatabase:

1) "LineType"  - abbreviations of conduit types (CLC, CBC, RCP, etc..)
2) "Asset_Type" - the full wording of these abbreviations (Concrete Line Channel, Concrete Box Culvert, Reinforced Concrete Pipe, etc..)

Am I forgetting something simple, or is there no way (outside of programming / scripting) to set up an auto-populate of the "Asset_Type" field in SDE?  I want to store this value, but don't want users to have to enter both fields for each new feature.  I can programatically handle this pretty easily, but my issue is that data entry will come from multiple sources, such as importing GPS data, importing data from proprietary software, and regular data entry using ArcMap.  Would rather do from the database side, not scripts.

Thanks for any help.
0 Kudos
9 Replies
RobertHu
New Contributor II
Code Value Domain?
0 Kudos
AndyMorgan
New Contributor
Code Value Domain?


Nope.  This just populates within the same field itself.  I was wondering if there's a way to populate a second field based on the first one.

For example, auto-populate [Asset_Type] with "Concrete Line Channel" when [LineType] has the value "CLC"
0 Kudos
AngelaGray
New Contributor III
The field calculator would allow you to do that.  The only way I know to access it is through the attribute table.

Click on the second field, I believe that would be asset_type?
Right click and select "field calculator"
then you can add your first field to the box

If you set up the Code Value Domain on the second field, then it should bring over that value

Sorry if I didn't explain well.  Don't have ArcMap open in front of me to help describe it better.
0 Kudos
AndyMorgan
New Contributor
Right click and select "field calculator"
then you can add your first field to the box

If you set up the Code Value Domain on the second field, then it should bring over that value


Thanks.  Unfortunately this is still a manual task to be done every so often rather than my desire for an auto-populate setting, but probably the only way.  Wish there was such a thing as an SDE trigger - not through the database but handled on the ArcSDE side.
0 Kudos
AndyMorgan
New Contributor
if anyone cares...my somewhat incomplete, but as-good-as-I'll-get it, solution:

Set the [Asset_Type] (full text field) to use a domain with the abbreviation as the code and full text as the value, and utilize this domain in my append process.  I will map the abbreviation field twice - once to the [LineType] field and then the same field again to the [Asset_Type] field which will convert it to the full text with the domain.
0 Kudos
JamesMacKay
New Contributor
Hi Andy,

I'm not sure if you're familiar with class extensions, but they're something along the lines of an SDE trigger. You create them using ArcObjects and they allow you to listen to events on a table or feature class.

You said: "my issue is that data entry will come from multiple sources, such as importing GPS data, importing data from proprietary software, and regular data entry using ArcMap". As long as all of these workflows go "through" ArcCatalog, ArcMap, or custom ArcObjects applications, the class extension's event handlers will be triggered.

Class extensions *won't* be triggered if a user is editing the data through SQL, however. Another downside is that class extensions require you to deploy and register a DLL to every machine that accesses the geodatabase directly - client machines without the DLL will not be able to open the feature class(es) that require the extension.

This page describes how to develop a class extension:
http://resources.esri.com/help/9.3/ArcGISDesktop/dotnet/6caed32d-8baf-4771-8bb4-2f350b7f0d7a.htm

Cheers,
James
0 Kudos
AndyMorgan
New Contributor
Thanks James!

A rather complex way to do it, but I had no idea this was possible.  Will look further into this.

Best regards,
Andy
0 Kudos
BrettHeist
New Contributor III

Did you have any success with this method of class extension? 

0 Kudos
DaveThompson101
New Contributor III

I'm encountering the same problem right now.  Andy, Brett, after all these years, has Esri created any easier solution for this workflow?

0 Kudos