Friday, April 27, 2012

My Journey to Success With the Attribute Assistant in ArcGIS


At the 2011 Esri User Conference I attended many of the Local Government breakout sessions showing the benefits of using the Local Government Information Model. In one of those sessions they mentioned the power of the Attribute Assistant that they use in the Infrastructure Editing Template and I thought it would be helpful in our efforts to create an address point layer for the county.

I learned that the Attribute Assistant can generate new sequential ids for new features, it can populate fields in the new feature with values in fields of nearby existing features, and many other functions. I felt this would be handy to automatically generate ids for my address points and I could use the street name value from the nearest street to populate the street field in my address points layer, and I could strip the house number from my parcel layer.

I installed the add-in shortly after returning home from the conference, but that was as far as I got due to the back log of tasks that had accumulated in my absence. However, the Attribute Assistant was constantly reminding me of its presence every time I started an edit session by telling me that I was missing a table called the DynamicValue table.

While I was trying out different methods of creating address points and populating their attributes, I decided to look into the Attribute Assistant again. So I did some searches on various Esri sites (resources, forums, support). I found the best description of how to configure the add in here. This overview was still lacking in detail and made reference to files like the config file but did not give out the location of the file. Or, it stated you needed two fields in the GenerateID table, but didn't specify what to name the fields or what data types the fields should be.

So here is what I learned through trial and error:

You will need to download either the Attribute Assistant add-in here, or download one of the templates that has it installed like the Infrastructure Editing Template, or the Address Data Management Template. It would probably be easier to download a template. I say easier meaning the tables and fields will be set up correctly to work with the data from the local government information model. If your data doesn't match the model, you can change the layer and field names in the two tables the Attribute Assistant uses to match your data.

The Attribute Assistant (AA hereafter) requires a table called DynamicValue to be in the map document you are working with.  If you want the AA to populate an ID field with an incrementing value you will also need to have a table called GenerateId in your map as well.  The GenerateId table needs to be in the same workspace as the data you are editing because the AA makes changes to the table by updating a field with the current ID value.

I was struggling getting the AA to work at the beginning because I had built my DynamicValue and GenerateId tables myself.  I got frustrated and ended up downloading the water utility editing template and copied the tables from the template into my own geodatabase and added them to the map and deleted all of their records and created my own.  Also if you download a template, you get all of the domains that are used in the fields for the DynamicValue table.

Each record in the DynamicValue table is an action you want the AA to perform.  The fields in the DynamicValue table are these:

TABLENAME - The table or layer that you want the AA to update.  You need to be sure you use the actual name of the layer or table, not what it is called in the table of contents.

FIELDNAME - This is the field in the table or layer that you want the AA to update.  Again, don't use field aliases, use their actual name.  You can get the actual field name from the table's properties window.

VALUEMETHOD - This is the keyword that tells the AA what action you want it to take.  If you read this document, it should explain the different value methods.

VALUEINFO - This field contains what I call arguments to the value method.  Sometimes it can be a layer name and a field name that you want a value to be copied into your field.  The value method document link explains these.

ON_CREATE - This tells the AA that you want to run the value method when a feature is created.  If you export or copy the DynamicValue table from a template you should get a domain for this field that has values of True (1) or False (0).

ON_CHANGE - Same as above only you want the value method run when a feature is changed.

ON_MANUAL - This is also a boolean type field like ON_CREATE and ON_CHANGE, but this one is triggered by you via a button on the AA toolbar.  So you can select a set of features and hit that button and the value method is run for those selected features.

RUNORDER - If you want the value methods in the table run in a certain order, you can specify that order here.

I'm not going to go into each value method, but I will give you links to the various forum posts and documents that I found that helped me.  The Attribute Assistant is also supported by esri tech support so you can actually call them and get some help.

Here are the links to sites that helped me get things working correctly:

Attribute Assistant Overview PDF document.
Address Data Management blog post.
Description of the Value Methods.

Feel free to post comments if you are having trouble getting it configured properly.  The Expression value method is extremely powerful.  You can grab a value from a field in a nearby feature and manipulate it using expressions that you can test in the field calculator.

Good Luck.