Select to view content in your preferred language

AddJoin not join layer and table in toolbox script

278
1
12-13-2023 12:00 PM
TonyAlmeida
Occasional Contributor II

I have a model that runs a script I get an error that states a field does not exist. Once the join happens they filed should exist, and looking at the outputs the join doesn't happend. I can run the stand alone script and also run the model and it runs fine.  When run the model in Pro scheduler I run into is issue. I have tried adding a a derived output parameter and still no launch when I run it out of Pro Scheduler.

join = arcpy.AddJoin_management("Lyr1","ACC_ID",table1, "ACC_ID", "KEEP_COMMON")
arcpy.SetParameterAsText(1,join)
arcpy.FeatureClassToFeatureClass_conversion("Lyr1", "C:/Temp/test.gdb", "BP_TestA")

2023-12-13 12_56_59-Window.png2023-12-13 12_57_13-Window.png

0 Kudos
1 Reply
TonyAlmeida
Occasional Contributor II

Couldn't figure out why this happened, I ended up using arcpy.management.JoinField instead of arcpy.AddJoin_management. Also, I didn't have to use a derived output parameter once I used the arcpy.management.JoinField.

0 Kudos