<?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: Python: select by Location and assign value from the source to the target in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/python-select-by-location-and-assign-value-from/m-p/487638#M38071</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Darren,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In my workflow option 3 might be a better an option. Spatial Join produces a &amp;nbsp;whole new feature class as an output, instead of transferring an attribute from a selected polygon to the point features within the selected polygon. &amp;nbsp;Thoughts?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 01 Sep 2016 21:17:22 GMT</pubDate>
    <dc:creator>DavidBuehler</dc:creator>
    <dc:date>2016-09-01T21:17:22Z</dc:date>
    <item>
      <title>Python: select by Location and assign value from the source to the target</title>
      <link>https://community.esri.com/t5/python-questions/python-select-by-location-and-assign-value-from/m-p/487634#M38067</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi All&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have a polygon layer with a 'lot' field and a points layer. I would like to use python to select the points by location (to find what points are contained in what polygons) and assign the value in the 'lot' field from the polygon layer to the point that is contained in the relevant polygon feature. Not sure how to create that link between the 2 layers...&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Any help is much appreciated. &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Thank you&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 07 Mar 2014 01:10:13 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-select-by-location-and-assign-value-from/m-p/487634#M38067</guid>
      <dc:creator>RyanFadd</dc:creator>
      <dc:date>2014-03-07T01:10:13Z</dc:date>
    </item>
    <item>
      <title>Re: Python: select by Location and assign value from the source to the target</title>
      <link>https://community.esri.com/t5/python-questions/python-select-by-location-and-assign-value-from/m-p/487635#M38068</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;There are 3 ways I can think of:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;1) Use arcpy to spatially join the lot attribute from the polygon to the point. &lt;/SPAN&gt;&lt;BR /&gt;&lt;A href="http://resources.arcgis.com/en/help/main/10.1/index.html#//00080000000q000000"&gt;http://resources.arcgis.com/en/help/main/10.1/index.html#//00080000000q000000&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;2) Use ArcPy to convert polygons to points and keep the attributes.&amp;nbsp; The points will be populated with the Lot values.&lt;/SPAN&gt;&lt;BR /&gt;&lt;A href="http://http://resources.arcgis.com/en/help/main/10.1/index.html#/Feature_To_Point/00170000003m000000/"&gt;http://http://resources.arcgis.com/en/help/main/10.1/index.html#/Feature_To_Point/00170000003m000000/&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;3) Use ArcPy to Select By Location, then calculate the point field values to equal lot number from the selected polygon feature; then use iterations of this process for each polygon in your feature class.&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;In my opinion I'd go with option 2 because it's the easiest. Option 3 is probably a more of a "learning experience".&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Have fun!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;G&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 07 Mar 2014 01:57:23 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-select-by-location-and-assign-value-from/m-p/487635#M38068</guid>
      <dc:creator>GregSnelling</dc:creator>
      <dc:date>2014-03-07T01:57:23Z</dc:date>
    </item>
    <item>
      <title>Re: Python: select by Location and assign value from the source to the target</title>
      <link>https://community.esri.com/t5/python-questions/python-select-by-location-and-assign-value-from/m-p/487636#M38069</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ryan,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Did you ever find a solution to your question? &amp;nbsp;Which option did you choose?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 01 Sep 2016 21:00:31 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-select-by-location-and-assign-value-from/m-p/487636#M38069</guid>
      <dc:creator>DavidBuehler</dc:creator>
      <dc:date>2016-09-01T21:00:31Z</dc:date>
    </item>
    <item>
      <title>Re: Python: select by Location and assign value from the source to the target</title>
      <link>https://community.esri.com/t5/python-questions/python-select-by-location-and-assign-value-from/m-p/487637#M38070</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;What's wrong with &lt;A href="http://desktop.arcgis.com/en/arcmap/latest/tools/analysis-toolbox/spatial-join.htm"&gt;Spatial Join&lt;/A&gt;?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 01 Sep 2016 21:06:52 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-select-by-location-and-assign-value-from/m-p/487637#M38070</guid>
      <dc:creator>DarrenWiens2</dc:creator>
      <dc:date>2016-09-01T21:06:52Z</dc:date>
    </item>
    <item>
      <title>Re: Python: select by Location and assign value from the source to the target</title>
      <link>https://community.esri.com/t5/python-questions/python-select-by-location-and-assign-value-from/m-p/487638#M38071</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Darren,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In my workflow option 3 might be a better an option. Spatial Join produces a &amp;nbsp;whole new feature class as an output, instead of transferring an attribute from a selected polygon to the point features within the selected polygon. &amp;nbsp;Thoughts?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 01 Sep 2016 21:17:22 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-select-by-location-and-assign-value-from/m-p/487638#M38071</guid>
      <dc:creator>DavidBuehler</dc:creator>
      <dc:date>2016-09-01T21:17:22Z</dc:date>
    </item>
    <item>
      <title>Re: Python: select by Location and assign value from the source to the target</title>
      <link>https://community.esri.com/t5/python-questions/python-select-by-location-and-assign-value-from/m-p/487639#M38072</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Oh I see. It probably depends somewhat on the size of the datasets. Suppose there are 1000 points. You could do 1000 individual selections/field calculations, or 1 spatial join (to an in-memory feature class if you don't want to keep it) then 1 join then 1 field calculation. I'm guessing the second option is faster, but haven't tested.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 01 Sep 2016 21:22:23 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-select-by-location-and-assign-value-from/m-p/487639#M38072</guid>
      <dc:creator>DarrenWiens2</dc:creator>
      <dc:date>2016-09-01T21:22:23Z</dc:date>
    </item>
    <item>
      <title>Re: Python: select by Location and assign value from the source to the target</title>
      <link>https://community.esri.com/t5/python-questions/python-select-by-location-and-assign-value-from/m-p/487640#M38073</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Darren,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I know I am not an efficient python scripter, so bear with me.&amp;nbsp;I have attempted to script it with spatial join. The goal is to calculate the zone of a concern for only the ones that the zone field is null. Both feature classes are in an enterprise environment (the concerns and the zones). &amp;nbsp;Here is what I have so far from testing on a file geodatabase. &amp;nbsp;I am not sure it is joining properly and the field calculator dies. Any suggestions?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="comment token"&gt;# import modules&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;import&lt;/SPAN&gt; arcpy

&lt;SPAN class="comment token"&gt;# Set workspaces&lt;/SPAN&gt;
workspace &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; r&lt;SPAN class="string token"&gt;'C:\ESRITest\GeoReportingSystem\Testing9116\Testing9116.gdb'&lt;/SPAN&gt;
outWorkspace &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; r&lt;SPAN class="string token"&gt;'C:\ESRITest\GeoReportingSystem\Testing9116\Scratch.gdb'&lt;/SPAN&gt;

targetFeatures &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; r&lt;SPAN class="string token"&gt;'C:\ESRITest\GeoReportingSystem\Testing9116\Testing9116.gdb\GeoReporting'&lt;/SPAN&gt;
joinFeatures &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; r&lt;SPAN class="string token"&gt;'C:\ESRITest\GeoReportingSystem\Testing9116\Testing9116.gdb\GRSAldermanic'&lt;/SPAN&gt;

outfc &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; r&lt;SPAN class="string token"&gt;'C:\ESRITest\GeoReportingSystem\Testing9116\Scratch.gdb\AldermanicSJ'&lt;/SPAN&gt;

fieldmappings &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;FieldMappings&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
fieldmappings&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;addTable&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;targetFeatures&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
fieldmappings&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;addTable&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;joinFeatures&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;

&lt;SPAN class="comment token"&gt;# Replace a layer/table view name with a path to a dataset (which can be a layer file) or create the layer/table view within the script&lt;/SPAN&gt;
&lt;SPAN class="comment token"&gt;# The following inputs are layers or table views: "GeoReporting Features", "GRSAldermanic"&lt;/SPAN&gt;
arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;SpatialJoin_analysis&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;target_features&lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt;targetFeatures&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; join_features&lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt;joinFeatures&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; out_feature_class&lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt;outfc&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; join_operation&lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"JOIN_ONE_TO_ONE"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; join_type&lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"KEEP_COMMON"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; field_mapping&lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt;fieldmappings&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; match_option&lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"INTERSECT"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; search_radius&lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;""&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; distance_field_name&lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;""&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;

&lt;SPAN class="keyword token"&gt;print&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"Done with Spatial Join"&lt;/SPAN&gt;

&lt;SPAN class="comment token"&gt;# Replace a layer/table view name with a path to a dataset (which can be a layer file) or create the layer/table view within the script&lt;/SPAN&gt;
&lt;SPAN class="comment token"&gt;# The following inputs are layers or table views: "AldermanicSJ"&lt;/SPAN&gt;
arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;DeleteField_management&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;in_table&lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt;outfc&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; drop_field&lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"SpecificConcern;DescriptionOfConcern;ReportingEmail;DateClosed;ConcernStatus;PriorityLevel;PrimaryDepartment;PrimaryContact;PrimaryInformation;DeptLogging;ReportingMethod;FollowUpRequest;FollowUpContactInfo;AldermanicDistrict;ApproriateYN;NUMVOTES;DaysToClose;Match_Addr;Loc_Name;created_user;created_date;last_edited_user;last_edited_date;Address;Visibility;Report_ID;DISTRICTID"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;

&lt;SPAN class="keyword token"&gt;print&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"Done with Deleting Fields"&lt;/SPAN&gt;

arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;MakeFeatureLayer_management&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;outfc&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"outfc_view"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;MakeFeatureLayer_management&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;targetFeatures&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"GRE_view"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&lt;SPAN class="comment token"&gt;# arcpy.MakeFeatureLayer_management(targetFeatures, "GRE_view")&lt;/SPAN&gt;
arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;AddJoin_management&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"GRE_view"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"ConcernID"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"outfc_view"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"ConcernID"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;

&lt;SPAN class="keyword token"&gt;print&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"Joined Up Sir"&lt;/SPAN&gt;

fieldName1 &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"GRE_view.AldermanicDistrict"&lt;/SPAN&gt;
fieldName2 &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"!outfc_view.NAME!"&lt;/SPAN&gt;

&lt;SPAN class="comment token"&gt;# Replace a layer/table view name with a path to a dataset (which can be a layer file) or create the layer/table view within the script&lt;/SPAN&gt;
&lt;SPAN class="comment token"&gt;# The following inputs are layers or table views: "GeoReporting Features"&lt;/SPAN&gt;
arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;CalculateField_management&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;in_table&lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt;targetFeatures&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; field&lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt;fieldName1&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; expression&lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt;fieldName2&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; expression_type&lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"PYTHON"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; code_block&lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;""&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;

&lt;SPAN class="keyword token"&gt;print&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"Field Calculation Done"&lt;/SPAN&gt;

arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;RemoveJoin_management&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;in_layer_or_view&lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt;targetFeatures&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;

&lt;SPAN class="keyword token"&gt;print&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"Removed Join"&lt;/SPAN&gt;

arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;DeleteFeatures_management&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;outfc&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;

&lt;SPAN class="keyword token"&gt;print&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"Spatial Join feature class deleted"&lt;/SPAN&gt;&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 21:28:00 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-select-by-location-and-assign-value-from/m-p/487640#M38073</guid>
      <dc:creator>DavidBuehler</dc:creator>
      <dc:date>2021-12-11T21:28:00Z</dc:date>
    </item>
    <item>
      <title>Re: Python: select by Location and assign value from the source to the target</title>
      <link>https://community.esri.com/t5/python-questions/python-select-by-location-and-assign-value-from/m-p/487641#M38074</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Perhaps try expression_type="PYTHON_9.3". If that doesn't work, can you provide the error message?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 02 Sep 2016 17:58:32 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-select-by-location-and-assign-value-from/m-p/487641#M38074</guid>
      <dc:creator>DarrenWiens2</dc:creator>
      <dc:date>2016-09-02T17:58:32Z</dc:date>
    </item>
    <item>
      <title>Re: Python: select by Location and assign value from the source to the target</title>
      <link>https://community.esri.com/t5/python-questions/python-select-by-location-and-assign-value-from/m-p/487642#M38075</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;ExecuteError: Failed to execute. Parameters are not valid.&lt;/P&gt;&lt;P&gt;Error 000728: Field GRE_view.AldermanicDistrict does not exist within table&lt;/P&gt;&lt;P&gt;Failed to to execute (CalculateField).&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 02 Sep 2016 18:04:49 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-select-by-location-and-assign-value-from/m-p/487642#M38075</guid>
      <dc:creator>DavidBuehler</dc:creator>
      <dc:date>2016-09-02T18:04:49Z</dc:date>
    </item>
    <item>
      <title>Re: Python: select by Location and assign value from the source to the target</title>
      <link>https://community.esri.com/t5/python-questions/python-select-by-location-and-assign-value-from/m-p/487643#M38076</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Have you tried running through the workflow manually to see exactly what's going on? You could also verify the field names like:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="language-python line-numbers"&gt;&lt;CODE&gt;&lt;SPAN class="keyword token"&gt;print&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;i&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;name &lt;SPAN class="keyword token"&gt;for&lt;/SPAN&gt; i &lt;SPAN class="keyword token"&gt;in&lt;/SPAN&gt; arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;ListFields&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;'GRE_view'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;‍‍&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 02 Sep 2016 18:22:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-select-by-location-and-assign-value-from/m-p/487643#M38076</guid>
      <dc:creator>DarrenWiens2</dc:creator>
      <dc:date>2016-09-02T18:22:06Z</dc:date>
    </item>
    <item>
      <title>Re: Python: select by Location and assign value from the source to the target</title>
      <link>https://community.esri.com/t5/python-questions/python-select-by-location-and-assign-value-from/m-p/487644#M38077</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am not quite sure what you mean by manual approach, but I have tried running things individually via arcmap, and each step of the script by itself. &amp;nbsp;The only thing that does not "work" is the field calculate. &amp;nbsp;I get a 000539 error Invalid field. Below is updated code. &amp;nbsp;Thoughts?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="comment token"&gt;# import modules&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;import&lt;/SPAN&gt; arcpy

&lt;SPAN class="comment token"&gt;# Set workspaces&lt;/SPAN&gt;
workspace &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; r&lt;SPAN class="string token"&gt;'C:\ESRITest\GeoReportingSystem\Testing9116\Testing9116.gdb'&lt;/SPAN&gt;
outWorkspace &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; r&lt;SPAN class="string token"&gt;'C:\ESRITest\GeoReportingSystem\Testing9116\Scratch.gdb'&lt;/SPAN&gt;

targetFeatures &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; r&lt;SPAN class="string token"&gt;'C:\ESRITest\GeoReportingSystem\Testing9116\Testing9116.gdb\GeoReporting'&lt;/SPAN&gt;
joinFeatures &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; r&lt;SPAN class="string token"&gt;'C:\ESRITest\GeoReportingSystem\Testing9116\Testing9116.gdb\GRSAldermanic'&lt;/SPAN&gt;

outfc &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; r&lt;SPAN class="string token"&gt;'C:\ESRITest\GeoReportingSystem\Testing9116\Scratch.gdb\AldermanicSJ'&lt;/SPAN&gt;

fieldmappings &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;FieldMappings&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
fieldmappings&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;addTable&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;targetFeatures&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
fieldmappings&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;addTable&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;joinFeatures&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;

&lt;SPAN class="comment token"&gt;# Replace a layer/table view name with a path to a dataset (which can be a layer file) or create the layer/table view within the script&lt;/SPAN&gt;
&lt;SPAN class="comment token"&gt;# The following inputs are layers or table views: "GeoReporting Features", "GRSAldermanic"&lt;/SPAN&gt;
arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;SpatialJoin_analysis&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;target_features&lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt;targetFeatures&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; join_features&lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt;joinFeatures&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; out_feature_class&lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt;outfc&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; join_operation&lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"JOIN_ONE_TO_ONE"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; join_type&lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"KEEP_COMMON"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; field_mapping&lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt;fieldmappings&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; match_option&lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"INTERSECT"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; search_radius&lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;""&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; distance_field_name&lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;""&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;

&lt;SPAN class="keyword token"&gt;print&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"Done with Spatial Join"&lt;/SPAN&gt;

&lt;SPAN class="comment token"&gt;# Replace a layer/table view name with a path to a dataset (which can be a layer file) or create the layer/table view within the script&lt;/SPAN&gt;
&lt;SPAN class="comment token"&gt;# The following inputs are layers or table views: "AldermanicSJ"&lt;/SPAN&gt;
arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;DeleteField_management&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;in_table&lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt;outfc&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; drop_field&lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"SpecificConcern;DescriptionOfConcern;ReportingEmail;DateClosed;ConcernStatus;PriorityLevel;PrimaryDepartment;PrimaryContact;PrimaryInformation;DeptLogging;ReportingMethod;FollowUpRequest;FollowUpContactInfo;AldermanicDistrict;ApproriateYN;NUMVOTES;DaysToClose;Match_Addr;Loc_Name;created_user;created_date;last_edited_user;last_edited_date;Address;Visibility;Report_ID;DISTRICTID"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;

&lt;SPAN class="keyword token"&gt;print&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"Done with Deleting Fields"&lt;/SPAN&gt;

layerName1 &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"outfc_view"&lt;/SPAN&gt;
layerName2 &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"GRE_view"&lt;/SPAN&gt;

&lt;SPAN class="comment token"&gt;#calcExpression ="!AldermanicSJ.NAME!"&lt;/SPAN&gt;


arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;MakeFeatureLayer_management&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;outfc&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"outfc_view"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;MakeFeatureLayer_management&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;targetFeatures&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"GRE_view"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&lt;SPAN class="comment token"&gt;# arcpy.MakeFeatureLayer_management(targetFeatures, "GRE_view")&lt;/SPAN&gt;
arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;AddJoin_management&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"GRE_view"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"ConcernID"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"outfc_view"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"ConcernID"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;

&lt;SPAN class="keyword token"&gt;print&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;i&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;name &lt;SPAN class="keyword token"&gt;for&lt;/SPAN&gt; i &lt;SPAN class="keyword token"&gt;in&lt;/SPAN&gt; arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;ListFields&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;'GRE_view'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;

&lt;SPAN class="keyword token"&gt;print&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"Joined Up Sir"&lt;/SPAN&gt;

fieldName1 &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"AldermanicDistrict"&lt;/SPAN&gt;
fieldName2 &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'AldermanicSJ.NAME'&lt;/SPAN&gt;
calcExpression &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"!"&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt;fieldName2&lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"!"&lt;/SPAN&gt;


&lt;SPAN class="comment token"&gt;# Replace a layer/table view name with a path to a dataset (which can be a layer file) or create the layer/table view within the script&lt;/SPAN&gt;
&lt;SPAN class="comment token"&gt;# The following inputs are layers or table views: "GeoReporting Features"&lt;/SPAN&gt;
arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;CalculateField_management&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;targetFeatures&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; fieldName1&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; calcExpression&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"PYTHON"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;

&lt;SPAN class="comment token"&gt;#print "Field Calculation Done"&lt;/SPAN&gt;

arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;RemoveJoin_management&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;layerName2&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"AldermanicSJ"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;

&lt;SPAN class="keyword token"&gt;print&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"Removed Join"&lt;/SPAN&gt;

arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;Delete_management&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;r&lt;SPAN class="string token"&gt;'C:\ESRITest\GeoReportingSystem\Testing9116\Scratch.gdb\AldermanicSJ'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;

&lt;SPAN class="keyword token"&gt;print&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"Spatial Join feature class deleted"&lt;/SPAN&gt;&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 21:28:03 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-select-by-location-and-assign-value-from/m-p/487644#M38077</guid>
      <dc:creator>DavidBuehler</dc:creator>
      <dc:date>2021-12-11T21:28:03Z</dc:date>
    </item>
    <item>
      <title>Re: Python: select by Location and assign value from the source to the target</title>
      <link>https://community.esri.com/t5/python-questions/python-select-by-location-and-assign-value-from/m-p/487645#M38078</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I should also add that when I did the line:&lt;/P&gt;&lt;PRE class="" style="color: #000000; background: #f5f2f0; border: 0px; margin: 0.5em 0px; padding: 1em 1em 1em 3.8em;"&gt;&lt;CODE style="border: 0px; font-weight: inherit;"&gt;&lt;SPAN class="" style="color: #0077aa; border: 0px; font-weight: inherit;"&gt;print&lt;/SPAN&gt; &lt;SPAN class="" style="color: #999999; border: 0px; font-weight: inherit;"&gt;[&lt;/SPAN&gt;i&lt;SPAN class="" style="color: #999999; border: 0px; font-weight: inherit;"&gt;.&lt;/SPAN&gt;name &lt;SPAN class="" style="color: #0077aa; border: 0px; font-weight: inherit;"&gt;for&lt;/SPAN&gt; i &lt;SPAN class="" style="color: #0077aa; border: 0px; font-weight: inherit;"&gt;in&lt;/SPAN&gt; arcpy&lt;SPAN class="" style="color: #999999; border: 0px; font-weight: inherit;"&gt;.&lt;/SPAN&gt;ListFields&lt;SPAN class="" style="color: #999999; border: 0px; font-weight: inherit;"&gt;(&lt;/SPAN&gt;&lt;SPAN class="" style="color: #669900; border: 0px; font-weight: inherit;"&gt;'GRE_view'&lt;/SPAN&gt;&lt;SPAN class="" style="color: #999999; border: 0px; font-weight: inherit;"&gt;)&lt;/SPAN&gt;&lt;SPAN class="" style="color: #999999; border: 0px; font-weight: inherit;"&gt;] &lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;It showed me:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;[u'GeoReporting.OBJECTID', u'GeoReporting.ConcernID', u'GeoReporting.GeneralConcern', u'GeoReporting.SpecificConcern', u'GeoReporting.DescriptionOfConcern', u'GeoReporting.ReportingEmail', u'GeoReporting.DateClosed', u'GeoReporting.ConcernStatus', u'GeoReporting.PriorityLevel', u'GeoReporting.PrimaryDepartment', u'GeoReporting.PrimaryContact', u'GeoReporting.PrimaryInformation', u'GeoReporting.DeptLogging', u'GeoReporting.ReportingMethod', u'GeoReporting.FollowUpRequest', u'GeoReporting.FollowUpContactInfo', u'GeoReporting.AldermanicDistrict', u'GeoReporting.ApproriateYN', u'GeoReporting.NUMVOTES', u'GeoReporting.DaysToClose', u'GeoReporting.GlobalID', u'GeoReporting.Match_Addr', u'GeoReporting.Loc_Name', u'GeoReporting.SHAPE', u'GeoReporting.created_user', u'GeoReporting.created_date', u'GeoReporting.last_edited_user', u'GeoReporting.last_edited_date', u'GeoReporting.Address', u'GeoReporting.Visibility', u'GeoReporting.Report_ID', u'AldermanicSJ.OBJECTID', u'AldermanicSJ.Join_Count', u'AldermanicSJ.TARGET_FID', u'AldermanicSJ.ConcernID', u'AldermanicSJ.GeneralConcern', u'AldermanicSJ.NAME']&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have tried various combinations of u'AldermanicSJ.NAME', but get that 000539 error&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 02 Sep 2016 20:04:40 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-select-by-location-and-assign-value-from/m-p/487645#M38078</guid>
      <dc:creator>DavidBuehler</dc:creator>
      <dc:date>2016-09-02T20:04:40Z</dc:date>
    </item>
    <item>
      <title>Re: Python: select by Location and assign value from the source to the target</title>
      <link>https://community.esri.com/t5/python-questions/python-select-by-location-and-assign-value-from/m-p/487646#M38079</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This would be my guess:&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;fieldName1 &lt;SPAN class="" style="color: #a67f59; background: rgba(255, 255, 255, 0.498039); border: 0px; font-weight: inherit; font-size: 14px;"&gt;=&lt;/SPAN&gt; &lt;SPAN class="" style="color: #669900; border: 0px; font-weight: inherit; font-size: 14px;"&gt;"&lt;SPAN style="color: #3d3d3d; background-color: #ffffff;"&gt;GeoReporting.AldermanicDistrict&lt;/SPAN&gt;"&lt;/SPAN&gt;
fieldName2 &lt;SPAN class="" style="color: #a67f59; background: rgba(255, 255, 255, 0.498039); border: 0px; font-weight: inherit; font-size: 14px;"&gt;=&lt;/SPAN&gt; &lt;SPAN style="color: #3d3d3d; background-color: #ffffff;"&gt;'AldermanicSJ.NAME'&lt;/SPAN&gt;
calcExpression &lt;SPAN class="" style="color: #a67f59; background: rgba(255, 255, 255, 0.498039); border: 0px; font-weight: inherit; font-size: 14px;"&gt;=&lt;/SPAN&gt;&lt;SPAN class="" style="color: #669900; border: 0px; font-weight: inherit; font-size: 14px;"&gt;"!"&lt;/SPAN&gt;&lt;SPAN class="" style="color: #a67f59; background: rgba(255, 255, 255, 0.498039); border: 0px; font-weight: inherit; font-size: 14px;"&gt;+&lt;/SPAN&gt;fieldName2&lt;SPAN class="" style="color: #a67f59; background: rgba(255, 255, 255, 0.498039); border: 0px; font-weight: inherit; font-size: 14px;"&gt;+&lt;/SPAN&gt;&lt;SPAN class="" style="color: #669900; border: 0px; font-weight: inherit; font-size: 14px;"&gt;"!"&lt;/SPAN&gt;


&lt;SPAN class="" style="color: slategray; border: 0px; font-weight: inherit; font-size: 14px;"&gt;# Replace a layer/table view name with a path to a dataset (which can be a layer file) or create the layer/table view within the script&lt;/SPAN&gt;
&lt;SPAN class="" style="color: slategray; border: 0px; font-weight: inherit; font-size: 14px;"&gt;# The following inputs are layers or table views: "GeoReporting Features"&lt;/SPAN&gt;
arcpy&lt;SPAN class="" style="color: #999999; border: 0px; font-weight: inherit; font-size: 14px;"&gt;.&lt;/SPAN&gt;CalculateField_management&lt;SPAN class="" style="color: #999999; border: 0px; font-weight: inherit; font-size: 14px;"&gt;(&lt;/SPAN&gt;targetFeatures&lt;SPAN class="" style="color: #999999; border: 0px; font-weight: inherit; font-size: 14px;"&gt;,&lt;/SPAN&gt; fieldName1&lt;SPAN class="" style="color: #999999; border: 0px; font-weight: inherit; font-size: 14px;"&gt;,&lt;/SPAN&gt; calcExpression&lt;SPAN class="" style="color: #999999; border: 0px; font-weight: inherit; font-size: 14px;"&gt;,&lt;/SPAN&gt; &lt;SPAN class="" style="color: #669900; border: 0px; font-weight: inherit; font-size: 14px;"&gt;"PYTHON"&lt;/SPAN&gt;&lt;SPAN class="" style="color: #999999; border: 0px; font-weight: inherit; font-size: 14px;"&gt;)&lt;/SPAN&gt;
&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 21:28:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-select-by-location-and-assign-value-from/m-p/487646#M38079</guid>
      <dc:creator>DarrenWiens2</dc:creator>
      <dc:date>2021-12-11T21:28:06Z</dc:date>
    </item>
    <item>
      <title>Re: Python: select by Location and assign value from the source to the target</title>
      <link>https://community.esri.com/t5/python-questions/python-select-by-location-and-assign-value-from/m-p/487647#M38080</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I got it to work. &amp;nbsp;I had tried your recommendation with no success. &amp;nbsp;After some trial and error and research, I figured it out. I had to use the view instead of the feature class to calculate on, and change the field variables to the use the output of the join. &amp;nbsp;See below:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;layerName1 &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"outfc_view"&lt;/SPAN&gt;
layerName2 &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"GRE_view"&lt;/SPAN&gt;

&lt;SPAN class="comment token"&gt;#calcExpression ="!AldermanicSJ.NAME!"&lt;/SPAN&gt;


arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;MakeFeatureLayer_management&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;outfc&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"outfc_view"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;MakeFeatureLayer_management&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;targetFeatures&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"GRE_view"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&lt;SPAN class="comment token"&gt;# arcpy.MakeFeatureLayer_management(targetFeatures, "GRE_view")&lt;/SPAN&gt;
arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;AddJoin_management&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"GRE_view"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"ConcernID"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"outfc_view"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"ConcernID"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;

&lt;SPAN class="keyword token"&gt;print&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;i&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;name &lt;SPAN class="keyword token"&gt;for&lt;/SPAN&gt; i &lt;SPAN class="keyword token"&gt;in&lt;/SPAN&gt; arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;ListFields&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;'GRE_view'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;

&lt;SPAN class="keyword token"&gt;print&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"Joined Up Sir"&lt;/SPAN&gt;

fieldName1 &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; u&lt;SPAN class="string token"&gt;'GeoReporting.AldermanicDistrict'&lt;/SPAN&gt;
fieldName2 &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; u&lt;SPAN class="string token"&gt;'AldermanicSJ.NAME'&lt;/SPAN&gt;
calcExpression &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"!"&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt; fieldName2 &lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"!"&lt;/SPAN&gt;


&lt;SPAN class="comment token"&gt;# Replace a layer/table view name with a path to a dataset (which can be a layer file) or create the layer/table view within the script&lt;/SPAN&gt;
&lt;SPAN class="comment token"&gt;# The following inputs are layers or table views: "GeoReporting Features"&lt;/SPAN&gt;
arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;CalculateField_management&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;layerName2&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; fieldName1&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; calcExpression&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"PYTHON_9.3"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 21:28:08 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-select-by-location-and-assign-value-from/m-p/487647#M38080</guid>
      <dc:creator>DavidBuehler</dc:creator>
      <dc:date>2021-12-11T21:28:08Z</dc:date>
    </item>
  </channel>
</rss>

