laptop and a wrench

Bug

The AddJoin function fails to create a join when used in a script tool.

Last Published: March 27, 2023 ArcGIS Pro
Bug ID Number BUG-000150795
SubmittedJuly 14, 2022
Last ModifiedOctober 7, 2024
Applies toArcGIS Pro
Version found2.9.3
Operating SystemWindows OS
Operating System Version10.0 64 Bit
StatusAs Designed

Additional Information

This is the expected behavior of the Add Join tool. The Add Join tool creates a temporary join that disappears at the end of a session. In a script tool, the join disappears at the conclusion of the script. Refer to, https://pro.arcgis.com/en/pro-app/2.8/tool-reference/data-management/add-join.htm, "The join persists only for the duration of the layer. A layer can be retained by saving the ArcGIS Pro session or by saving it to a layer file using the Save Layer To File tool." To persist the join on a map, set the AddJoin function in the script as a derived output. For example: lyr = arcpy.management.AddJoin(fc, fc_field, joinLayer, joinLayer_field) arcpy.SetParameterAsText(4, lyr) Then, in the script tool properties, in the Parameters section, set Parameter 4 to Type=Derived and Direction=Output to link it to the SetParameterAsText call in the script.

Workaround

  • Use the Add Join geoprocessing tool.
  • Run in the Python window.

Steps to Reproduce

Bug ID: BUG-000150795

Software:

  • ArcGIS Pro

Get notified when the status of a bug changes

Download the Esri Support App

Discover more on this topic

Get help from ArcGIS experts

Contact technical support

Download the Esri Support App

Go to download options