1

I would like to know if there is a way to even possibly populate field value automatically for a column based on the condition of other columns. Not sure what the best way to explain but to provide an example here:

Essentially, I have an attribute table with 5 columns. I've established the domain in which the values can only be numbers (1 or 2). Ideally I would like to create a sixth column in which will auto populate based on the values from the previous 5 columns. The condition is this, if there is a value 2 in any of the columns the sixth column would be valued at 2. If all columns were listed at 1 then the sixth column would be 1.

I do not wish to auto generate this manually. I would like it in a way in which when the first 5 columns are populated, the sixth value will auto generate.

marked as duplicate by Chris W, PolyGeo Mar 24 '15 at 23:48

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • 1
    Do you want the values be inserted each time a user adds a new row/feature? Or you want to do it periodically? Where do you store your data? – Alex Tereshenkov Mar 24 '15 at 7:03
  • Field calculator max [!Fld1!, [Fld2!..] – FelixIP Mar 24 '15 at 8:52
  • @alex, ideaaly I would like to update the value each time a user adds a new row/feature. So the first five columns can be updates manually but the sixth column needs to be automated. Field calculator will work but its not ideal for me at this point. – bobsays48 Mar 24 '15 at 14:37
1

You would need to use database triggers for that (which is supported only when storing data in a DBMS). If you are on file/personal geodatabase, you would need to run a Python script that would calculate the columns regularly (scheduled in Windows as a task, for instance).

There is no way you could implement database triggers in a file geodatabase; there is no out-of-the-box control that would fire up calculating the field based on editing of the rows. All possible solutions would involve ArcObjects or Python scripting with custom attribute editing forms.

0

You could write a Class Extension and register it with the table. It will then receive all create, update, delete events for the table. In those event handlers you would run your specific logic to calculate the value for your 6th column.

See: http://help.arcgis.com/en/sdk/10.0/arcobjects_net/conceptualhelp/index.html#//000100000201000000

0

It completely depends on the data entry process, but if you could redirect the workflow so that the users are using a custom script tool with a dialog box to create the features, you could set it up so the user values get written directly to the row and the fifth column gets calculated when the users submit the changes. A python add-in might work.

The use cases where this would be practical are pretty limited though, I would say.

Not the answer you're looking for? Browse other questions tagged or ask your own question.