FieldInfo.addField - what does it do

931
2
Jump to solution
10-27-2017 07:00 AM
JohnDye
Occasional Contributor III

Does anyone have an example of what the addField method in the FieldInfo class does? The documentation on it is not particularly helpful. I was wondering if it might be a very efficient method to add a field to a feature layer.

0 Kudos
1 Solution

Accepted Solutions
DanPatterson_Retired
MVP Emeritus

It looks like if enables you to rename the field in the layer or table view only, not the featureclass or table.

http://pro.arcgis.com/en/pro-app/arcpy/classes/fieldinfo.htm

addField (field_name, new_field_name, visible, split_rule)

Adds a field info entry

View solution in original post

2 Replies
DanPatterson_Retired
MVP Emeritus

It looks like if enables you to rename the field in the layer or table view only, not the featureclass or table.

http://pro.arcgis.com/en/pro-app/arcpy/classes/fieldinfo.htm

addField (field_name, new_field_name, visible, split_rule)

Adds a field info entry

JoshuaBixby
MVP Esteemed Contributor

One of the only examples I have found in Esri documentation, see MakeTableView example 2 from Make Table View—Help | ArcGIS Desktop