Hi all, hope you are well,
I am trying to perform a join field between two lists of feature classes using a for loop. Currently I am joining each item in the list with the corresponding item in another list individually. Here is a snippet of code -
#Creating list of points. Splitting into groups of 1 & 2
SamplePoints1 = ["PT1_points_DirWestLines", "PT1_points_DirSouthLines", "PT1_points_DirEastLines", "PT1_points_DirNorthLines"]
SamplePoints2 = ["PT2_points_DirWestLines", "PT2_points_DirSouthLines", "PT2_points_DirEastLines", "PT2_points_DirNorthLines"]
AllPoints = ["SamplePoints1","SamplePoints2"]
#Altering to preserve info on which group the point came from
for points2 in SamplePoints2:
arcpy.management.AlterField(points2, "Elevation", "Elevation_2", "Elevation_2", "FLOAT", 4, "NULLABLE", "DO_NOT_CLEAR")
#Joining back both point lists
###Here is where I am facing challenges
arcpy.management.JoinField("PT1_points_DirNorthLines", "OBJECTID", "PT2_points_DirNorthLines", "OBJECTID", None, "USE_FM", 'Elevation_2 "Elevation_2" true true false 4 Float 0 0,First,#,PT2_points_DirEastLines,Elevation_2,-1,-1')
arcpy.management.JoinField("PT1_points_DirEastLines", "OBJECTID", "PT2_points_DirEastLines", "OBJECTID", None, "USE_FM", 'Elevation_2 "Elevation_2" true true false 4 Float 0 0,First,#,PT2_points_DirEastLines,Elevation_2,-1,-1')
arcpy.management.JoinField("PT1_points_DirSouthLines", "OBJECTID", "PT2_points_DirSouthLines", "OBJECTID", None, "USE_FM", 'Elevation_2 "Elevation_2" true true false 4 Float 0 0,First,#,PT2_points_DirEastLines,Elevation_2,-1,-1')
arcpy.management.JoinField("PT1_points_DirWestLines", "OBJECTID", "PT2_points_DirWestLines", "OBJECTID", None, "USE_FM", 'Elevation_2 "Elevation_2" true true false 4 Float 0 0,First,#,PT2_points_DirEastLines,Elevation_2,-1,-1')
Here's the Syntax for the join field tool -
arcpy.management.JoinField(in_data, in_field, join_table, join_field, {fields}, {fm_option}, {field_mapping})
Is there a method to achieve the join field as lists or do I have to do each individually? Any help is appreciated. Please let me know if there is anything else you need to assist me.
Regards, Kedar