arcpy.env.qualifiedFieldNames = False not working when using arcpy.AddJoin_management

Discussion created by DemersM on Dec 7, 2017
Latest reply on Dec 7, 2017 by Dan_Patterson

I would like to add a join on a layer while keeping the original fields names, so I thought setting the qualifiedFieldNames  environment parameter to False would do the job, as the documentation says, but it has no effect.


import arcpy, os
arcpy.env.qualifiedFieldNames = False

input_fc = os.path.join("C:\\", "temp", "GEODEV.sde", "dataset", "my_feature_class")
join_table = arcpy.TableToTable_conversion(os.path.join("C:\\", "temp", "to_join.csv"), "in_memory", "join_table")
layer = arcpy.MakeFeatureLayer_management(input_fc, "in_memory\\layer")
arcpy.AddJoin_management(layer, "MY_IN_FIELD", join_table, "MY_JOIN_FIELD")

print([ for f in arcpy.ListFields(layer)])

>>>'["GEODEV.dataset.field1", "GEODEV.dataset.field2", "GEODEV.dataset.field3", "join_table.fieldA", "join_table.fieldB", "join_table.fieldC"]'



What am I doing wrong?


Thank you for your help!