The best practice to transfer values from a filed in a table to another field in an attribute table of feature class using a model,

929
6
Jump to solution
04-18-2017 09:53 AM
JamalNUMAN
Esteemed Contributor

The best practice to transfer values from a filed in a table to another field in an attribute table of feature class using a model,

 

For example, I wanted to replace the values stored in the “enabled” field of P1 feature class with their corresponding values stored in “enabled-Sc” filed stored in J1. What tools might do this sort of thing effectively and efficiently within the capacity of model builder knowing that there is a common field between the stand-alone table (J1) and the attribute table (P1).

 

Thank you

 

Best

 

Jamal

----------------------------------------
Jamal Numan
Geomolg Geoportal for Spatial Information
Ramallah, West Bank, Palestine
1 Solution

Accepted Solutions
AlaaFlaifel
Occasional Contributor

The model below succeeded to transfer values from a field in a table to another field in an attribute table of feature class. There was no need to delete any field instead, calculate field was able to update the field. This is especially useful in case the field to be updated is unable to be deleted like enabled field in a geometric network attribute table.  

View solution in original post

6 Replies
JakeSkinner
Esri Esteemed Contributor

Hi Jamal,

You have a couple options:

1.  Use the Add Join tool to join the two tables, and then run the Calculate Field tool

2.  Delete the field you do not need using the Delete Field tool, then execute the Join Field tool to join the field with the correct values

AlaaFlaifel
Occasional Contributor

The model below succeeded to transfer values from a field in a table to another field in an attribute table of feature class. There was no need to delete any field instead, calculate field was able to update the field. This is especially useful in case the field to be updated is unable to be deleted like enabled field in a geometric network attribute table.  

JamalNUMAN
Esteemed Contributor

This is brilliant! It works fine for me. However, it is very surprising that values written in the “table view” are transferred to the physical feature class! Is this by design?

----------------------------------------
Jamal Numan
Geomolg Geoportal for Spatial Information
Ramallah, West Bank, Palestine
0 Kudos
curtvprice
MVP Esteemed Contributor

values written in the “table view” are transferred to the physical feature class! Is this by design?

Yes, layers and table views do not store data, just point to data. When you update values, add fields, etc. in a table view or layer, the referenced dataset is updated.

Moving, hiding and showing field, and sorting in table view doesn't affect the data -- but calculating, adding and deleting fields definitely does change the source dataset!

curtvprice
MVP Esteemed Contributor

An alternative method (that has the nice property that you don't need to know the name of the dataset to clean up like you do with Remove Join) is to delete your table view instead of running Remove Join. Set the result object coming out of Calculate Field as the precondition to Delete to make sure the Delete happens after the Calculate Field. Note this will only delete the table view, not the data.

AlaaFlaifel
Occasional Contributor

Thanks Curtis.

This option worked well in updating the field data too.