Select to view content in your preferred language

Make Feature Layer ArcGIS Pro - change field names

2642
5
08-19-2019 04:28 PM
Status: Closed
Labels (1)
ScottBridwell
New Contributor III

When running Make Feature Layer in ArcGIS Pro, how can field names be changed? This was possible in ArcMap. Also it appears that using arcpy.MakeFeatureLayer_management with field infos to change the field names does not work.

5 Comments
ThomasColson

ArcMap: Can change field name

Pro: Can't....


Arcmap help explicitly states "Field names can be given a new name by using the Field Info control. The second column on the control lists the existing field names from the input. To rename a field, click the field name and type in a new one."

While Pro help, this text is not present. 

DanPatterson_Retired

You can always change them later

Alter Field—Data Management toolbox | ArcGIS Desktop 

ScottBridwell

Thanks for the clarification.

I don't understand why this would change in Pro. Especially when many of us have developed workflows and scripts that assume things will behave this way. I suppose I'll have to re-write everything to use FeatureClassToFeatureClass instead .

by Anonymous User

to future users who find this thread...

I need this functionality to clean up field names after joins and to add a prefix to identify sources. This is very frustrating that this has not been addressed 7 years later.

I thought I'd work around the FL limitation by changing the field names in the table view before my join. After all, the FieldInfo and MakeTableView  documentation explicitly state that changing field names can be done (even in the MTV examples!?!?) - but alas it does not work.

Even if it did, I'd still be stuck dealing with absurdly long field names like schema_name.really_long_table_name.potentially_long_field_name which is clearly difficult to work with.

So instead of Make layers \ join \ field info \ export to destination FGDB, I'll now have to Make layers \ join \ export to scratch \ build an output FC shell in the destination FGDB \ create a field map \ and append.

And I tried Dan's Alter Field recommendation, but it failed on "required" fields even though none of my fields are set as required.

DrewFlater
Status changed to: Closed

After technical review, the development team has found that renaming fields using the Make Feature Layer and other tools' Field Info parameter cannot be supported in ArcGIS Pro due to the new design of layers and field definition storage. 

In ArcMap, renaming fields using the Field Info has this description:

Field names can be given a new name by using the Field Info control. The second column on the control lists the existing field names from the input. To rename a field, click the field name and type in a new one.

Field names defined in the Field Info control will be honored in subsequent tools. However, if this tool is the last tool in a model, the field names will be obtained from the source data on disk. To maintain the field names, the new layer has to be written out to a new data using Copy Rows or Copy Features tools.

Notice specifically that the new field names were only used by subsequent geoprocessing tools, and were not displayed in the application. Workflows that were previously using Copy Rows or Copy Features to make a new output with the renamed fields can use the Export Features or Export Table tools in Pro, which offers a Field Map parameter where fields can be renamed, among many other things. If there is a workflow that is impacted by creating this intermediate copy of the dataset, you can consider writing the output of Export Features to the memory workspace for fast performance and so you will not have another copy of the data to clean up.