Update Attribute with Description from Domain List using a Model

1894
2
11-06-2014 10:51 AM
KaelDowdy
New Contributor III

Hello,

This is something I would think would be easy, but I'm stumbling around...

I have a model that I'm using to transfer a feature class from an Oracle SDE to a file GDB (using the Feature Class to Feature Class tool).  Just to make the illustration simple, in the Field Map parameter for that tool, I have two fields:

  • Construction_Status_ID (which comes from the SDE -- Long datatype -- but displays the coded value/description from the domain list)
  • Construction_Status (which is a field I added --Text datatype -- and I mapped the Construction_Status_ID to it)

When the tool runs, and I look at the attribute table, I can see the translated description in the Construction_Status_ID field but in the Construction_Status field, I just see the coded value.  It's weird too that the Construction_Status_ID field is right-justified (just like it is for long or integer datatypes), but I guess that's to be expected since that datatype is actually a long.

At any rate, what I'm wanting to do is to update the Construction_Status field with my actual description value from my domain list (instead of the coded value).  I'm needing the data persisted for other steps down the line, so that's why I'm wanting the text description as opposed to the numerical value equivalent.

For example, here are what the values look like in the feature class that's in the GDB:

ObjectIDConstruction_Status_IDConstruction_Status
1Existing10
2Proposed20
3Retired30

While I'd like to be able to update or persist the actual text values during the Feature Class to Feature Class step, I'm not seeing a way to do it...

So, I'm looking for a tool that can accept a domain list as an input, and then map my coded value to the Construction_Status_ID field and then update the Construction_Status field to the domain list's description value.

I tried Field Calculator tool, but I didn't see a way to map or interface with a domain list -- although I could create a VB or Python function that would run over each row.  However, I'd have to hardcode each value for the lookup and I'd want to stay away from that if at all possible.

Is there a way to update an attribute in this way using a domain list as an input source?  My feature classes will have over 500K rows in case that plays a part in the solution.

Thanks for any ideas...

0 Kudos
2 Replies
ThomasTri
New Contributor II

There's a couple of approaches. First is to convert the domain to a temporary table using the GP tool. Then by using joins and field calculations you could populate the descriptions into the appropriate fields. Another approach would be to export to a shapefile while setting the environment variable (arcpy.env.transferDomains). This would transfer the descriptions rather than the coded values.

0 Kudos
KaelDowdy
New Contributor III

I thought about converting the domain list to a table and doing a join.  I was hoping there'd be a more direct way to do it, but I think this option will work.  Just be curious on the performance...will have to test it out tomorrow.

Thanks for the info.

0 Kudos