AnsweredAssumed Answered

Field mapping 10.3.1

Question asked by 2Quik1 on Sep 27, 2016
Latest reply on Sep 28, 2016 by 2Quik1

 i upgraded from 10.2.2 to 10.3.1 and now my script does not run properly. It runs all they way and doesn't give an error.

The join runs fin and it creates the feature class but when i check feature class "NotifiLotsTest" all the fields are Null.

It ran fine in 10.2.2 so i am not sure what's going on with it now, something to do with the field mapping???.. help please i am lost it's a simple script but i can't figure out what's going on....

 

arcpy.env.qualifiedFieldNames = False
arcpy.env.overwriteOutput = True

Taxparcels = r"Database Connections\Taxparcels"
Table = r"Database Connections\Table"

fc = "C:/Temp/Test.gdb/NotifLotsTest"

#Delete feature class if it exists
if arcpy.Exists(fc):
   arcpy.Delete_management(fc)

fc1 = "C:/Temp/Test.gdb/NotifTest"

#Delete feature class if it exists
if arcpy.Exists(fc1):
   arcpy.Delete_management(fc1)  

# Process: Make Feature Layer
arcpy.MakeFeatureLayer_management(Taxparcels, "In_memory\TaxPar")

# Process: Add Join
arcpy.AddJoin_management("In_memory\TaxPar", "ACCOUNT", Table, "Acct")

#check to make sure Joined Feature class is being generated
arcpy.FeatureClassToFeatureClass_conversion("In_memory\TaxPar","C:/Temp/Test.gdb/", "NotifTest")

TaxPar1 = "In_memory\TaxPar"
#arcpy.MakeFeatureLayer_management("C:/Temp/Test.gdb//NotifTest",TaxPar1)

#Field Mapping
def Layers0(TaxPar1):
    FieldMapString = "" \
                + """DXF_TEXT "DXF_TEXT" true true false 20 Text 0 0 ,First,#,""" + TaxPar1 + """,DXF_TEXT,-1,-1;"""\
                + """ACCOUNT "ACCOUNT" true true false 11 Text 0 0 ,First,#,""" + TaxPar1 + """,ACCOUNT,-1,-1;"""\
                + """OwnerName "OwnerName" true true false 100 Text 0 0 ,First,#,""" + TaxPar1 + """,OwnerName,-1,-1;"""\
                + """Address "Address" true true false 64 Text 0 0 ,First,#,""" + TaxPar1 + """,Address,-1,-1;"""\
                + """City "City" true true false 32 Text 0 0 ,First,#,""" + TaxPar1 + """,City,-1,-1;"""\
                + """State "State" true true false 4 Text 0 0 ,First,#,""" + TaxPar1 + """,State,-1,-1;"""\
                + """ZipCode "ZipCode" true true false 10 Text 0 0 ,First,#,""" + TaxPar1 + """,ZipCode,-1,-1;"""\

    fieldmappings = arcpy.FieldMappings()
    fieldmappings.loadFromString(FieldMapString)
    return fieldmappings
def main(args=None):
        if args is None:
                args = sys.argv

# Process: Feature Class to Feature Class
arcpy.FeatureClassToFeatureClass_conversion(TaxPar1, "C:/Temp/Test.gdb/", "NotifLotsTest", "", Layers0(TaxPar1),"")


Outcomes