Select to view content in your preferred language

add join and unusable header names in arcpy

3455
10
01-02-2018 04:17 PM
PhilBeilin1
Regular Contributor

I am writing a script that uses the Add Join function. This works fine but the result changes the header names to stuff I cannot use like Parcel_D_1, Parcel_D_2, Parcel_D_3. 

It is important that I have usable header names for the next step of my script.

Has anyone else had this problem and know a way around it?

0 Kudos
10 Replies
RandyBurton
MVP Alum

I don't think AddJoin likes to join shape files.  The code is hard to read, but it looked like you created the shape files from feature layers created by MakeFeatureLayer.  Try using these feature layers instead of the saved shape files in the AddJoin.

Also see code formatting as it will help make your code easier to read.

# feature "Earlier"/"EarlierFC" created at line 28
# feature "Later"/"LaterFC" created at line 35

arcpy.AddJoin_management("Later", "APN", "Earlier", "APN", "KEEP_ALL")