When running feature class to feature class as a batch tool in ArcGIS Pro and providing multiple input classes or layers, the field mapping shows incorrect schema. Running the tool also produces outputs with incorrect schema.
Can someone please confirm if they can reproduce this or if it is just me.
Thanks
In the internals, BUG-000124621 is in the Product Planned to be fixed. Just don't know when unfortunately.
I can confirm the problem using Arcgis Pro 2.8 or 2.9. The bug is on bach tool or using the tool in the model with the iterators on the feature class.
Bug is still present in 2.9.5. And if you upgrade to 3.0.2 it really breaks things when you copy and paste FC into new GDB. If there is a domain applied to fields in the FC, even though they are checked to allow null values, it adds a copy of the FC with D_[field name] to your FCs. Really fun. (Yes, I'm going to go research that bug next.)
I also have this issue when running FeatureclassToFeatureClass as a batch on 16 input layers (mixture of geodatabase feature classes and shapefiles). It gives all fields of all input datasets to all output datasets. I wasn't sure whether this was by design or not. After reading this thread I tried Export Features, as the bug report suggests the bug is fixed in that tool. Didn't work for me.
I don't want to do anything fancy with field maps. Just want the fields of each input dataset reproduced on each output dataset.
I then tried Export Features on just a single feature class and even that did not faithfully reproduce all field (it dropped a text field for some reason).
The workaround I used was looping the tool in Python rather than running the tool as a batch. Maybe this will help someone else:
The below assumes all input datasets are in their own map and it is currently open in ArcGIS Pro.
# Get current project, map and store map's layers as list
aprx = arcpy.mp.ArcGISProject("CURRENT")
m = aprx.ActiveMap
l = m.listLayers()
# Loop through every layer, sending each to FeatureClassToFeatureClass
for ls in l:
layerName = ls.name
# Using lyr names as output feature class name, so replacing spaces
newName = layerName.replace(' ','_')
arcpy.conversion.FeatureClassToFeatureClass(ls,"<path to output gdb.gdb>",newName)
Hi,
I ran into this issue as well, but in my workflow I found that running a batch project tool gave me all feature class outputs with the correct fields, and not the combined fields of all layers in each layer that batch feature class to feature class was producing.