Sign up ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

hi guys i m doing a script in Arcgis i m new to this, i have to append some field from a table to another, i did this script in python but i have a problem when it want make the Mapping field with a field of type shape shape i mean = point, line, polygon ..

the error that i get is this one:

FieldMap: Error in adding input field to field map Failed to execute (script).

# import system modules
import arcpy, os
from arcpy import env

# get parameters
tabellaInput = arcpy.GetParameterAsText(0)

tabellaOutput = arcpy.GetParameterAsText(1)
# Set local variables
fieldMappings = arcpy.FieldMappings()
# add the table to field mapping

fieldnames = [ for f in arcpy.ListFields(tabellaInput)]
fieldnamesOut = [ for f in arcpy.ListFields(tabellaOutput)]

for elem in fieldnames:

if str(elem) not in fieldnamesOut:

#creat a field map for each field.
fldMap = arcpy.FieldMap()
fldMap.addInputField(tabellaInput,elem) # deve aggiugere questo field

# Set name of new output field
namefield = fldMap.outputField = elem
fldMap.outputField = namefield
# Add output field to field mappings object

schemaType = "NO_TEST"
subtype = ""


# Process: Append the feature classes into   feature class
arcpy.Append_management(tabellaInput, tabellaOutput, schemaType, fieldMappings, subtype)

# If an error occurred while running a tool print the messages
print arcpy.GetMessages()

it dose stop inside the


when come a field of type shape

infact if i add inside the


the following line of code:

 if elem == 'Shape':

it works good .. this is pretty strange. Another things is this: I have more fields in the input table then the target table so why in the target i don't see all the fields of the input table? i should do a merge e not the append??

share|improve this question

2 Answers 2

It's a feature not a bug. Seems that you do not need to add the SHAPE field to mapping, it will always be included and remain in the feature class. You can't seem to rename it either.

share|improve this answer

There is a very similar problem described and resolved in the ArcGIS Discussion Forums.

The solution seems to have been to use Add and Calculate Field to make sure that the input fields on all input tables are absolutely identical.

share|improve this answer
fields are equal thx for reply i trying –  user9143 Jul 27 '12 at 7:45

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.