<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: ArcGIS Pro Python AddJoin in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/arcgis-pro-python-addjoin/m-p/1017220#M59535</link>
    <description>&lt;P&gt;If I understand correctly, when you perform the join using the geoprocessing tool or model builder, you get the expected behaviour. However, running the join from a Python script you saved from the geoprocessing tool results, your dataset does not get joined?&lt;/P&gt;&lt;P&gt;Where are you running your script file from, and where are you expecting to see the results? For example, are you running the Python script file by double-clicking it in Windows, and then looking for the result in ArcGIS Pro?&lt;/P&gt;</description>
    <pubDate>Fri, 15 Jan 2021 14:20:11 GMT</pubDate>
    <dc:creator>DavidBlanchard</dc:creator>
    <dc:date>2021-01-15T14:20:11Z</dc:date>
    <item>
      <title>ArcGIS Pro Python AddJoin</title>
      <link>https://community.esri.com/t5/python-questions/arcgis-pro-python-addjoin/m-p/1016171#M59490</link>
      <description>&lt;P&gt;In ArcGIS Pro, I am running the AddJoin tool.&amp;nbsp; I have run this command from ModelBuilder and from the Data Management Geoprocessing tool.&amp;nbsp; Obviously, after running the tool, it functions as it should by joining one featureclass to another.&amp;nbsp; After running from Geoprocessing, I saved as a Python script.&amp;nbsp; When I create a new script in Pro, then reference the file I just created, it does not create the join.&amp;nbsp; It runs and completes successfully but no effect?&lt;/P&gt;&lt;P&gt;arcpy.management.AddJoin("INFEATURE1", "JOINFIELD1", "INFEATURE2", "JOINFIELD2", "KEEP_ALL")&lt;/P&gt;&lt;P&gt;Is there some backend event like a refresh or response that occurs from a Geoprocessing tool that would not necessarily be reflected in the Python script?&lt;/P&gt;</description>
      <pubDate>Tue, 12 Jan 2021 22:16:57 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcgis-pro-python-addjoin/m-p/1016171#M59490</guid>
      <dc:creator>Darrin_Smith</dc:creator>
      <dc:date>2021-01-12T22:16:57Z</dc:date>
    </item>
    <item>
      <title>Re: ArcGIS Pro Python AddJoin</title>
      <link>https://community.esri.com/t5/python-questions/arcgis-pro-python-addjoin/m-p/1016177#M59491</link>
      <description>&lt;P&gt;&lt;A href="https://pro.arcgis.com/en/pro-app/latest/tool-reference/data-management/add-join.htm" target="_blank" rel="noopener"&gt;Add Join (Data Management)—ArcGIS Pro | Documentation&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;This join is temporary.&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;SPAN&gt;To make a permanent join, either use the&lt;/SPAN&gt;&lt;/EM&gt;&amp;nbsp;&lt;A href="https://pro.arcgis.com/en/pro-app/2.7/tool-reference/data-management/join-field.htm" target="_blank"&gt;Join Field&lt;/A&gt;tool or use the joined layer as input to one of the following tools:&lt;A href="https://pro.arcgis.com/en/pro-app/2.7/tool-reference/data-management/copy-features.htm" target="_blank"&gt;Copy Features&lt;/A&gt;,&lt;A href="https://pro.arcgis.com/en/pro-app/2.7/tool-reference/data-management/copy-rows.htm" target="_blank"&gt;Copy Rows&lt;/A&gt;,&lt;A href="https://pro.arcgis.com/en/pro-app/2.7/tool-reference/conversion/feature-class-to-feature-class.htm" target="_blank"&gt;Feature Class To Feature Class&lt;/A&gt;, or&lt;A href="https://pro.arcgis.com/en/pro-app/2.7/tool-reference/conversion/table-to-table.htm" target="_blank"&gt;Table To Table&lt;/A&gt;.When saving the results to a new feature class or table, the&lt;A href="https://pro.arcgis.com/en/pro-app/2.7/tool-reference/environment-settings/qualified-field-names.htm" target="_blank"&gt;Qualified Field Names&lt;/A&gt;e&lt;EM&gt;&lt;SPAN&gt;nvironment can be used to control whether the joined output field names will be qualified with the name of the table the field came from.&lt;/SPAN&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;A href="https://pro.arcgis.com/en/pro-app/latest/tool-reference/data-management/join-field.htm" target="_blank" rel="noopener"&gt;Join Field (Data Management)—ArcGIS Pro | Documentation&lt;/A&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;is different&lt;/P&gt;</description>
      <pubDate>Tue, 12 Jan 2021 22:35:26 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcgis-pro-python-addjoin/m-p/1016177#M59491</guid>
      <dc:creator>DanPatterson</dc:creator>
      <dc:date>2021-01-12T22:35:26Z</dc:date>
    </item>
    <item>
      <title>Re: ArcGIS Pro Python AddJoin</title>
      <link>https://community.esri.com/t5/python-questions/arcgis-pro-python-addjoin/m-p/1016233#M59494</link>
      <description>&lt;P&gt;The Join is intended to be temporary so I believe the AddJoin command is correct.&amp;nbsp; The issue is it does not create the join.&amp;nbsp; The attribute table does not contain the joined fields and the Data Tab--&amp;gt;Joins dropdown is empty i.e. there are no Joins to remove that would normally be listed after AddJoin.&amp;nbsp; Running the command from Python script does nothing.&amp;nbsp; This is the same exact command and syntax that the Geoprocessing tool uses.&amp;nbsp; The only thing I can come up with is must I explicitly define some Derived Output.&lt;/P&gt;</description>
      <pubDate>Wed, 13 Jan 2021 01:07:50 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcgis-pro-python-addjoin/m-p/1016233#M59494</guid>
      <dc:creator>Darrin_Smith</dc:creator>
      <dc:date>2021-01-13T01:07:50Z</dc:date>
    </item>
    <item>
      <title>Re: ArcGIS Pro Python AddJoin</title>
      <link>https://community.esri.com/t5/python-questions/arcgis-pro-python-addjoin/m-p/1016258#M59495</link>
      <description>&lt;P&gt;The joins are temporary, so you need to specify a new output featureclass/table to persist the join.&lt;/P&gt;&lt;P&gt;The link and notes I posted was for ArcGIS Pro 2.7.&lt;/P&gt;&lt;P&gt;An alternative is to use numpy structured arrays and arcpy's TableToNumPyArray to get a tabular data out of Pro.&amp;nbsp; To bring an array back in you use arcpy's ExtendTable ... That option makes permanent joins and the whole process doesn't even require a toolset or specifying parameters.&lt;/P&gt;&lt;P&gt;&lt;A href="https://pro.arcgis.com/en/pro-app/latest/arcpy/data-access/tabletonumpyarray.htm" target="_blank"&gt;TableToNumPyArray—ArcGIS Pro | Documentation&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://pro.arcgis.com/en/pro-app/latest/arcpy/data-access/extendtable.htm" target="_blank"&gt;ExtendTable—ArcGIS Pro | Documentation&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 13 Jan 2021 03:17:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcgis-pro-python-addjoin/m-p/1016258#M59495</guid>
      <dc:creator>DanPatterson</dc:creator>
      <dc:date>2021-01-13T03:17:04Z</dc:date>
    </item>
    <item>
      <title>Re: ArcGIS Pro Python AddJoin</title>
      <link>https://community.esri.com/t5/python-questions/arcgis-pro-python-addjoin/m-p/1016339#M59496</link>
      <description>&lt;P&gt;For my workflows, it must be a temporary join with the intent to join, calculate a value, then remove the join.&amp;nbsp; I did find a post from 2019 with the same issue.&amp;nbsp;&amp;nbsp;&lt;A href="https://community.esri.com/t5/arcgis-pro-questions/arcpy-addjoin-not-working-in-arcgis-pro-script/td-p/503309" target="_blank"&gt;arcpy.AddJoin Not Working In ArcGIS Pro Script - GeoNet, The Esri Community&lt;/A&gt;&lt;/P&gt;&lt;P&gt;I now know the AddJoin command creates the join as expected when run from the Python window.&amp;nbsp; One thing I did notice after running from the Python window was the History results lists the input layer as an Output Layer or View compared to the script results which does not (it reports No Parameters)&lt;/P&gt;</description>
      <pubDate>Wed, 13 Jan 2021 14:10:36 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcgis-pro-python-addjoin/m-p/1016339#M59496</guid>
      <dc:creator>Darrin_Smith</dc:creator>
      <dc:date>2021-01-13T14:10:36Z</dc:date>
    </item>
    <item>
      <title>Re: ArcGIS Pro Python AddJoin</title>
      <link>https://community.esri.com/t5/python-questions/arcgis-pro-python-addjoin/m-p/1016404#M59498</link>
      <description>&lt;P&gt;That makes the case for using numpy more solid.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Alternately, to use existing tools, do the join but send the output to in_memory, do the calculation, then it gets deleted automatically from memory when you are done&lt;/P&gt;&lt;P&gt;&lt;A href="https://pro.arcgis.com/en/pro-app/latest/tool-reference/appendices/using-the-in-memory-output-workspace.htm" target="_blank" rel="noopener"&gt;Considerations when using the in_memory workspace—ArcGIS Pro | Documentation&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 13 Jan 2021 16:48:54 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcgis-pro-python-addjoin/m-p/1016404#M59498</guid>
      <dc:creator>DanPatterson</dc:creator>
      <dc:date>2021-01-13T16:48:54Z</dc:date>
    </item>
    <item>
      <title>Re: ArcGIS Pro Python AddJoin</title>
      <link>https://community.esri.com/t5/python-questions/arcgis-pro-python-addjoin/m-p/1017220#M59535</link>
      <description>&lt;P&gt;If I understand correctly, when you perform the join using the geoprocessing tool or model builder, you get the expected behaviour. However, running the join from a Python script you saved from the geoprocessing tool results, your dataset does not get joined?&lt;/P&gt;&lt;P&gt;Where are you running your script file from, and where are you expecting to see the results? For example, are you running the Python script file by double-clicking it in Windows, and then looking for the result in ArcGIS Pro?&lt;/P&gt;</description>
      <pubDate>Fri, 15 Jan 2021 14:20:11 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcgis-pro-python-addjoin/m-p/1017220#M59535</guid>
      <dc:creator>DavidBlanchard</dc:creator>
      <dc:date>2021-01-15T14:20:11Z</dc:date>
    </item>
    <item>
      <title>Re: ArcGIS Pro Python AddJoin</title>
      <link>https://community.esri.com/t5/python-questions/arcgis-pro-python-addjoin/m-p/1017238#M59538</link>
      <description>&lt;P&gt;Correct.&amp;nbsp; The script does not create the Join, but ModelBuilder and the out of the box geoprocessing tool do.&lt;/P&gt;&lt;P&gt;The script is run within Pro.&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;The&amp;nbsp;&lt;SPAN&gt;in_layer_or_view is a hosted feature layer.&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN&gt;I have tried variables for the path + layer as well as the simple layer name as found in the map.&amp;nbsp; Both of which demonstrate a successful run (the green checkmark).&amp;nbsp; Below is the script which uses the simple layername:&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN&gt;To confirm it does or does not work, I check two sources.&lt;/SPAN&gt;&lt;UL&gt;&lt;LI&gt;&lt;SPAN&gt;One is to open the in layer attribute table which does not contain the join fields&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN&gt;The other is to look at Data Tab--&amp;gt;Joins pulldown menu where "Remove Join" and "Remove All Joins" are grayed out.&lt;/SPAN&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN&gt;The only difference I see in the Script and Geoprocessor is the Parameters from History where the Script has no parameters but the Geoprocessor notes an updated layer (see attachment)&lt;/SPAN&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;import arcpy&lt;/P&gt;&lt;P&gt;#Reference map document from within ArcGIS Pro&lt;/P&gt;&lt;P&gt;aprx = arcpy.mp.ArcGISProject('CURRENT')&lt;/P&gt;&lt;P&gt;map = aprx.activeMap&lt;/P&gt;&lt;P&gt;# Process: Add Join (Data Management)&lt;/P&gt;&lt;P&gt;path = "\\\\localpath\Test.gdb\\"&lt;/P&gt;&lt;P&gt;hostedpath = "&lt;A href="https://services7.arcgis.com/zHNS16tz3znqN3gM/arcgis/rest/services/TEST_gdb/FeatureServer/0" target="_blank"&gt;https://services7.arcgis.com/zHNS16tz3znqN3gM/arcgis/rest/services/TEST_gdb/FeatureServer/0&lt;/A&gt;"&lt;/P&gt;&lt;P&gt;feature1 = "SWNODE"&lt;/P&gt;&lt;P&gt;feature2 = "JUNK"&lt;/P&gt;&lt;P&gt;infeature1 = hostedpath&lt;/P&gt;&lt;P&gt;infeature2 = path + feature2&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;arcpy.AddJoin_management(feature1, "INPUTID", "feature2", "INPUTID", "KEEP_ALL")&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 15 Jan 2021 15:05:01 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcgis-pro-python-addjoin/m-p/1017238#M59538</guid>
      <dc:creator>Darrin_Smith</dc:creator>
      <dc:date>2021-01-15T15:05:01Z</dc:date>
    </item>
    <item>
      <title>Re: ArcGIS Pro Python AddJoin</title>
      <link>https://community.esri.com/t5/python-questions/arcgis-pro-python-addjoin/m-p/1017240#M59539</link>
      <description>&lt;P&gt;&lt;A href="https://pro.arcgis.com/en/pro-app/latest/tool-reference/data-management/validate-join.htm" target="_blank"&gt;Validate Join (Data Management)—ArcGIS Pro | Documentation&lt;/A&gt;&amp;nbsp;might be a good addition prior to AddJoin and check its results&lt;/P&gt;</description>
      <pubDate>Fri, 15 Jan 2021 15:10:19 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcgis-pro-python-addjoin/m-p/1017240#M59539</guid>
      <dc:creator>DanPatterson</dc:creator>
      <dc:date>2021-01-15T15:10:19Z</dc:date>
    </item>
    <item>
      <title>Re: ArcGIS Pro Python AddJoin</title>
      <link>https://community.esri.com/t5/python-questions/arcgis-pro-python-addjoin/m-p/1017360#M59547</link>
      <description>&lt;P&gt;You say you run the script in ArcGIS Pro. Do you have it setup as a Toolbox script tool. Do you copy-paste it into the Python window? Or do you launch it from the Python window (if so, what command do you use to do that).&lt;/P&gt;</description>
      <pubDate>Fri, 15 Jan 2021 20:17:39 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcgis-pro-python-addjoin/m-p/1017360#M59547</guid>
      <dc:creator>DavidBlanchard</dc:creator>
      <dc:date>2021-01-15T20:17:39Z</dc:date>
    </item>
    <item>
      <title>Re: ArcGIS Pro Python AddJoin</title>
      <link>https://community.esri.com/t5/python-questions/arcgis-pro-python-addjoin/m-p/1017367#M59548</link>
      <description>&lt;P&gt;Yes it is a Toolbox script tool (not a Python Toolbox).&amp;nbsp; I just Run directly from the Toolbox.&amp;nbsp; However, if I copy/paste the entire script into the Python window it creates the join?&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Note in my script example above I did remove the quotes from feature2.&amp;nbsp; I inadvertently had that when I copied the code into this post.&lt;/EM&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 15 Jan 2021 20:42:57 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcgis-pro-python-addjoin/m-p/1017367#M59548</guid>
      <dc:creator>Darrin_Smith</dc:creator>
      <dc:date>2021-01-15T20:42:57Z</dc:date>
    </item>
    <item>
      <title>Re: ArcGIS Pro Python AddJoin</title>
      <link>https://community.esri.com/t5/python-questions/arcgis-pro-python-addjoin/m-p/1017689#M59559</link>
      <description>&lt;P&gt;I can't get it to work either. The script works as expected when copy-pasted into the Python window, but when run as a script, it doesn't apply the join.&lt;/P&gt;&lt;P&gt;Below is the script I modified to try and get it to work (but it did not):&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;import arcpy

in_layer_name = 'Alpha'
join_table = 'C:\\Users\\dblanchard\\Desktop\\Python_Join\\Default.gdb\\Beta'
join_field = 'JID'

# Get the currently active map
aprx = arcpy.mp.ArcGISProject('CURRENT')
map = aprx.activeMap

# Get the in layer from the map
in_layer_list = map.listLayers(in_layer_name)

if len(in_layer_list) == 1:
	in_layer = in_layer_list[0]
	arcpy.management.AddJoin(in_layer, join_field, join_table, join_field, "KEEP_ALL")
	aprx.save()

else:
	arcpy.AddError('Found {} layers matching the "{}" name when only 1 was expected.'.format(len(in_layer_list), in_layer_name))&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I also experienced this issue when using ModelBuilder. It works if I run it with the model open, but if I close the model and run it from the toolbox, it doesn't apply the join.&lt;/P&gt;&lt;P&gt;I would suggest you log a support ticket if you have access to &lt;A href="https://support.esri.com/en/contact-tech-support" target="_self"&gt;Esri Support&lt;/A&gt;. Unfortunately, I cannot log a support ticket on your behalf.&lt;/P&gt;&lt;P&gt;A workaround which may be suitable for you is to use a &lt;A href="https://pro.arcgis.com/en/pro-app/latest/help/tasks/whatistask.htm" target="_self"&gt;Task&lt;/A&gt;. I have a tried a simple task which has the &lt;EM&gt;Add Join&lt;/EM&gt; tool in it and it works as expected.&lt;/P&gt;</description>
      <pubDate>Mon, 18 Jan 2021 15:39:34 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcgis-pro-python-addjoin/m-p/1017689#M59559</guid>
      <dc:creator>DavidBlanchard</dc:creator>
      <dc:date>2021-01-18T15:39:34Z</dc:date>
    </item>
    <item>
      <title>Re: ArcGIS Pro Python AddJoin</title>
      <link>https://community.esri.com/t5/python-questions/arcgis-pro-python-addjoin/m-p/1017968#M59573</link>
      <description>&lt;P&gt;Thanks for the responses.&amp;nbsp; I will go to Esri support.&amp;nbsp; I am also confirming it is successful as a Task.&amp;nbsp;&lt;/P&gt;&lt;P&gt;One note about your ModelBuilder comment.&amp;nbsp; I understand a Model will not run again after it has been run without first doing a Validate.&amp;nbsp; If I run from the ModelBuilder tab, it will display the attached message.&amp;nbsp; If I simply Run as a geoprocess, it will give me a green check, but does nothing probably because it needs to be validated.&amp;nbsp; My question on the side is, do you know how to automate validating a model?&amp;nbsp; I would love to run a Python script that would loop through all my Models and validate them.&amp;nbsp; Otherwise, I must open them up in Edit mode and Validate--Run.&lt;/P&gt;</description>
      <pubDate>Tue, 19 Jan 2021 16:07:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcgis-pro-python-addjoin/m-p/1017968#M59573</guid>
      <dc:creator>Darrin_Smith</dc:creator>
      <dc:date>2021-01-19T16:07:04Z</dc:date>
    </item>
    <item>
      <title>Re: ArcGIS Pro Python AddJoin</title>
      <link>https://community.esri.com/t5/python-questions/arcgis-pro-python-addjoin/m-p/1159077#M64208</link>
      <description>&lt;P&gt;Did ESRI ever respond to this issue?&amp;nbsp; I see this problem as well.&amp;nbsp; Frustrating.&lt;/P&gt;</description>
      <pubDate>Tue, 29 Mar 2022 19:58:26 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcgis-pro-python-addjoin/m-p/1159077#M64208</guid>
      <dc:creator>Scott_T_Anderson</dc:creator>
      <dc:date>2022-03-29T19:58:26Z</dc:date>
    </item>
    <item>
      <title>Re: ArcGIS Pro Python AddJoin</title>
      <link>https://community.esri.com/t5/python-questions/arcgis-pro-python-addjoin/m-p/1196164#M65070</link>
      <description>&lt;P&gt;echoing Scott's question. I'm seeing the same issue. Would love to know if/how you resolved it?&lt;/P&gt;</description>
      <pubDate>Tue, 26 Jul 2022 23:49:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcgis-pro-python-addjoin/m-p/1196164#M65070</guid>
      <dc:creator>meloking_PNM</dc:creator>
      <dc:date>2022-07-26T23:49:42Z</dc:date>
    </item>
    <item>
      <title>Re: ArcGIS Pro Python AddJoin</title>
      <link>https://community.esri.com/t5/python-questions/arcgis-pro-python-addjoin/m-p/1196742#M65080</link>
      <description>&lt;P&gt;The docs 'quietly' say at the end of the last bullet that the join is temporary: "This join is temporary." so you must save the output for it to persist. Maybe try saving the output to a new featureclass?&lt;/P&gt;&lt;P&gt;If you also look at their examples, they all include a Copy Features method at the end.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I do think they should emphasize that the join is temporary and you must save it for it to last.&lt;/P&gt;</description>
      <pubDate>Thu, 28 Jul 2022 13:44:57 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcgis-pro-python-addjoin/m-p/1196742#M65080</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2022-07-28T13:44:57Z</dc:date>
    </item>
  </channel>
</rss>

