<?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: Update attributes of selected in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/update-attributes-of-selected/m-p/230914#M17898</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You have to cycle through the selection,&lt;/P&gt;&lt;P&gt;A couple of print statements would make it apparent whether you are getting just the first or just the last &lt;IMG src="https://community.esri.com/legacyfs/online/emoticons/wink.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 11 Sep 2020 23:14:13 GMT</pubDate>
    <dc:creator>DanPatterson</dc:creator>
    <dc:date>2020-09-11T23:14:13Z</dc:date>
    <item>
      <title>Update attributes of selected</title>
      <link>https://community.esri.com/t5/python-questions/update-attributes-of-selected/m-p/230903#M17887</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Trying to update some well data from another layer. I am trying to do this in Arcmap (10.6) with a tool/script (3.6.10 Python).&lt;/P&gt;&lt;P&gt;I need to transfer attributes from WellParcels to WellsPoints. I would like to do this with out starting a Edit session in python if possible as this tends to slow down the process...? I would manual start an edit session in ArcMap then run the tool/script when I have points selected, I currently have the following but error out on line 44. I am not sure this is the best/fastest way of doing it, so if someone has a different idea please share how I would do this with my data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;import arcpy,os

arcpy.env.overwriteOutput = True

arcpy.env.workspace = r'Database Connections\Connection to blah.sde'
ptSelection = "WellPoints"  
pointLayer = arcpy.env.workspace + os.sep + "WellPoints"  
parcel = 'WellParcels' 
sjpoints = "In_memory\sjpoints"


try: 
    ptCount = int(arcpy.GetCount_management(ptSelection).getOutput(0))

    dsc = arcpy.Describe(ptSelection)     
    selection_set = dsc.FIDSet             
    if len(selection_set) == 0:           
        print "There are no features selected"        
                     
    elif ptCount &amp;gt;= 1:
        arcpy.SelectLayerByLocation_management(parcel,"INTERSECT",ptSelection)
        arcpy.MakeFeatureLayer_management(parcel,"parcel_lyr")        
        
        arcpy.SpatialJoin_analysis(ptSelection, "parcel_lyr" , sjpoints)
        #sourceFieldsList = 'WellID', 'dept', 'type', ' Geothermal' 'GeoWaterUs', 'Temp', 'TempDate'
        #valueDict = {r[0]:(r[1:]) for r in arcpy.da.SearchCursor(sjpoints, sourceFieldsList)}

        fldList = ['WellID', 'dept', 'type', ' Geothermal' 'GeoWaterUs', 'Temp', 'TempDate']          
        fldDict ={}
        print (fldDict)

        targetFields = ['W_ID', 'dept', 'type', ' Geothermal' 'GeoWaterUs', 'Temp', 'TempDate']         
                      
        with arcpy.da.UpdateCursor(ptSelection, targetFields) as cursor:
            for row in cursor
            row[0] = ['W_ID']
            row[1] = ['dep']
            row[2] = ['type']
            row[3] = ['Geothermal']
            row[4] = ['GeoWaterUs']
            row[5] = ['Temp']
            row[6] = ['TempDate']
            #Attributes from Wellparcels     
            curosr.append(fldDict['Account', 'dept', 'type', ' Geothermal' 'GeoWaterUs', 'Temp', 'TempDate'])     
except Exception, e:     
    # If an error occurred, print line number and error message     
    import traceback, sys     
    tb = sys.exc_info()[2]     
    print("Line %i" % tb.tb_lineno)  
    arcpy.AddMessage("Line %i" % tb.tb_lineno)  
    print(e.message)  
    arcpy.AddMessage(e.message)  ‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍&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;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 11:13:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/update-attributes-of-selected/m-p/230903#M17887</guid>
      <dc:creator>2Quiker</dc:creator>
      <dc:date>2021-12-11T11:13:04Z</dc:date>
    </item>
    <item>
      <title>Re: Update attributes of selected</title>
      <link>https://community.esri.com/t5/python-questions/update-attributes-of-selected/m-p/230904#M17888</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;On line #44, cursor is spelled wrong.&amp;nbsp; Also, the ArcPy DA update cursor doesn't have an append method.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 10 Sep 2020 19:14:12 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/update-attributes-of-selected/m-p/230904#M17888</guid>
      <dc:creator>JoshuaBixby</dc:creator>
      <dc:date>2020-09-10T19:14:12Z</dc:date>
    </item>
    <item>
      <title>Re: Update attributes of selected</title>
      <link>https://community.esri.com/t5/python-questions/update-attributes-of-selected/m-p/230905#M17889</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="font-family: arial, helvetica, sans-serif;"&gt;Got it, thanks. So &lt;CODE&gt;with arcpy.da.UpdateCursor&lt;/CODE&gt; can on be updated with &lt;/SPAN&gt;&lt;CODE&gt;&lt;SPAN style="font-family: arial, helvetica, sans-serif;"&gt;arcpy&lt;SPAN class=""&gt;.&lt;/SPAN&gt;da&lt;SPAN class=""&gt;.&lt;/SPAN&gt;Editor. I am trying to do this inside Arcmap with an editor session started but it seems as if i use arcpy.da.UpdateCurosr it won't let me.&lt;/SPAN&gt;&lt;BR /&gt;&lt;/CODE&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 10 Sep 2020 21:25:59 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/update-attributes-of-selected/m-p/230905#M17889</guid>
      <dc:creator>2Quiker</dc:creator>
      <dc:date>2020-09-10T21:25:59Z</dc:date>
    </item>
    <item>
      <title>Re: Update attributes of selected</title>
      <link>https://community.esri.com/t5/python-questions/update-attributes-of-selected/m-p/230906#M17890</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes, update cursors can be used within edit sessions.&amp;nbsp; What is the code you are running, and what exactly is the error and traceback?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 11 Sep 2020 01:59:25 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/update-attributes-of-selected/m-p/230906#M17890</guid>
      <dc:creator>JoshuaBixby</dc:creator>
      <dc:date>2020-09-11T01:59:25Z</dc:date>
    </item>
    <item>
      <title>Re: Update attributes of selected</title>
      <link>https://community.esri.com/t5/python-questions/update-attributes-of-selected/m-p/230907#M17891</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can't be using python 3.6.10 because&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;print "There are no features selected"&amp;nbsp;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;would have errored out.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also, line 35 needs a colon&amp;nbsp; &amp;nbsp;&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;for row in cursor&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and 36-43 need to be indented.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And, why not remove the try- except stuff, dedent your code accordingly so you get unaltered error messages.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You get trackback error lines numbers and error messages without them AND no errors get hidden or obfuscated.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 11 Sep 2020 03:00:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/update-attributes-of-selected/m-p/230907#M17891</guid>
      <dc:creator>DanPatterson</dc:creator>
      <dc:date>2020-09-11T03:00:04Z</dc:date>
    </item>
    <item>
      <title>Re: Update attributes of selected</title>
      <link>https://community.esri.com/t5/python-questions/update-attributes-of-selected/m-p/230908#M17892</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I was able to find something that works but it currently only works for one feature at a time, I need it to work with one or 10,20,50. How can I get this to work with with multiple selected features?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;import arcpy,os

arcpy.env.overwriteOutput = True

arcpy.env.workspace = r'Database Connections\Connection to blah.sde'
ptSelection = "WellPoints"  
pointLayer = arcpy.env.workspace + os.sep + "WellPoints"  
parcel = 'WellParcels' 
sjpoints = "In_memory\sjpoints"



ptCount = int(arcpy.GetCount_management(ptSelection).getOutput(0))

dsc = arcpy.Describe(ptSelection)     
selection_set = dsc.FIDSet             
if len(selection_set) == 0:           
    print "There are no features selected"        
                 
elif ptCount &amp;gt;= 1:
    arcpy.SelectLayerByLocation_management(parcel,"INTERSECT",ptSelection)
    arcpy.MakeFeatureLayer_management(parcel,"parcel_lyr")        
    
    fldList = ['WellID', 'dept', 'type', ' Geothermal' 'GeoWaterUs', 'Temp', 'TempDate']          
    fldDict ={}

    if int(arcpy.GetCount_management("parcel_lyr").getOutput(0))==1:        
        for parrow in arcpy.da.SearchCursor("parcel_lyr",fldList):        
            for w in range(len(fldList)):        
                fldDict[fldList&lt;W&gt;]=parrow&lt;W&gt;        
    del parrow

    targetFields = ['W_ID', 'dept', 'type', ' Geothermal' 'GeoWaterUs', 'Temp', 'TempDate']         
                  
    with arcpy.da.UpdateCursor(ptSelection, targetFields) as cursor:
        for row in cursor
        row = []
        row.append(fldDict['WellID']
        row.append(fldDict['dep']
        row.append(fldDict['type']
        row.append(fldDict['Geothermal']
        row.append(fldDict['GeoWaterUs']
        row.append(fldDict['Temp']
        row.append(fldDict['TempDate']
        rows.updateRow(row)
    del row
&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;/W&gt;&lt;/W&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 11:13:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/update-attributes-of-selected/m-p/230908#M17892</guid>
      <dc:creator>2Quiker</dc:creator>
      <dc:date>2021-12-11T11:13:06Z</dc:date>
    </item>
    <item>
      <title>Re: Update attributes of selected</title>
      <link>https://community.esri.com/t5/python-questions/update-attributes-of-selected/m-p/230909#M17893</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Your right I am on 2.7.14.&lt;/P&gt;&lt;P&gt;I figured that I was on 3.6.10 because that the version of the shell I am using.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2.7.14 (v2.7.14:84471935ed, Sep 16 2017, 20:19:30) [MSC v.1500 32 bit (Intel)]&lt;BR /&gt;1.5.2&lt;BR /&gt;1.9.3&lt;BR /&gt;0.17.0&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 11 Sep 2020 15:13:32 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/update-attributes-of-selected/m-p/230909#M17893</guid>
      <dc:creator>2Quiker</dc:creator>
      <dc:date>2020-09-11T15:13:32Z</dc:date>
    </item>
    <item>
      <title>Re: Update attributes of selected</title>
      <link>https://community.esri.com/t5/python-questions/update-attributes-of-selected/m-p/230910#M17894</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You still didn't fix the rest like I suggested.&amp;nbsp; Lines 34 onward&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;you need a colon after cursor&lt;/P&gt;&lt;P&gt;The remaining lines need to be indented&lt;/P&gt;&lt;P&gt;you redefine row as an empty list&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Did you not get any error messages?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; with arcpy.da.UpdateCursor(ptSelection, targetFields) as cursor:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; for row in cursor
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; row = []
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; row.append(fldDict['WellID']
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; row.append(fldDict['dep']
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; row.append(fldDict['type']
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; row.append(fldDict['Geothermal']
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; row.append(fldDict['GeoWaterUs']
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; row.append(fldDict['Temp']
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; row.append(fldDict['TempDate']
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; rows.updateRow(row)&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 11:13:08 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/update-attributes-of-selected/m-p/230910#M17894</guid>
      <dc:creator>DanPatterson</dc:creator>
      <dc:date>2021-12-11T11:13:08Z</dc:date>
    </item>
    <item>
      <title>Re: Update attributes of selected</title>
      <link>https://community.esri.com/t5/python-questions/update-attributes-of-selected/m-p/230911#M17895</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I thought I had pasted the code with the indent and when I pasted the code and without the empty list but I didn't, sorry about that.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The code does have the the indent and empty list removed.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;import arcpy,os

arcpy.env.overwriteOutput = True

arcpy.env.workspace = r'Database Connections\Connection to blah.sde'
ptSelection = "WellPoints"  
pointLayer = arcpy.env.workspace + os.sep + "WellPoints"  
parcel = 'WellParcels' 


ptCount = int(arcpy.GetCount_management(ptSelection).getOutput(0))

dsc = arcpy.Describe(ptSelection)     
selection_set = dsc.FIDSet             
if len(selection_set) == 0:           
    print "There are no features selected"        
                 
elif ptCount &amp;gt;= 1:
    arcpy.SelectLayerByLocation_management(parcel,"INTERSECT",ptSelection)
    arcpy.MakeFeatureLayer_management(parcel,"parcel_lyr")        
    
    fldList = ['WellID', 'dept', 'type', ' Geothermal' 'GeoWaterUs', 'Temp', 'TempDate']          
    fldDict ={}

    if int(arcpy.GetCount_management("parcel_lyr").getOutput(0))==1:        
        for parrow in arcpy.da.SearchCursor("parcel_lyr",fldList):        
            for w in range(len(fldList)):        
                fldDict[fldList&lt;W&gt;]=parrow&lt;W&gt;        
    del parrow

    targetFields = ['W_ID', 'dept', 'type', ' Geothermal' 'GeoWaterUs', 'Temp', 'TempDate']         
                  
    with arcpy.da.UpdateCursor(ptSelection, targetFields) as cursor:
        for row in cursor:
            row.append(fldDict['WellID']
            row.append(fldDict['dep']
            row.append(fldDict['type']
            row.append(fldDict['Geothermal']
            row.append(fldDict['GeoWaterUs']
            row.append(fldDict['Temp']
            row.append(fldDict['TempDate']
            rows.updateRow(row)
    del row‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍&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;/W&gt;&lt;/W&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 11:13:11 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/update-attributes-of-selected/m-p/230911#M17895</guid>
      <dc:creator>2Quiker</dc:creator>
      <dc:date>2021-12-11T11:13:11Z</dc:date>
    </item>
    <item>
      <title>Re: Update attributes of selected</title>
      <link>https://community.esri.com/t5/python-questions/update-attributes-of-selected/m-p/230912#M17896</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;tiny steps... tiny steps...&lt;/P&gt;&lt;P&gt;you still didn't get the crucial line correct&lt;/P&gt;&lt;PRE class="" style="color: #000000; background: #f5f2f0; border: 0px; font-size: 14px; margin: 0.5em 0px; padding: 1em 1em 1em 3.8em;"&gt;&lt;CODE style="border: 0px; font-weight: inherit; font-size: 14px;"&gt;for row in cursor&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;should be&lt;/P&gt;&lt;PRE class="" style="color: #000000; background: #f5f2f0; border: 0px; font-size: 14px; margin: 0.5em 0px; padding: 1em 1em 1em 3.8em;"&gt;&lt;CODE style="border: 0px; font-weight: inherit; font-size: 14px;"&gt;for row in cursor:&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 11 Sep 2020 21:27:34 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/update-attributes-of-selected/m-p/230912#M17896</guid>
      <dc:creator>DanPatterson</dc:creator>
      <dc:date>2020-09-11T21:27:34Z</dc:date>
    </item>
    <item>
      <title>Re: Update attributes of selected</title>
      <link>https://community.esri.com/t5/python-questions/update-attributes-of-selected/m-p/230913#M17897</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sorry about that. How do I get this to work on multiple selected? It works great with one feature selected but not with multiple.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 11 Sep 2020 22:44:53 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/update-attributes-of-selected/m-p/230913#M17897</guid>
      <dc:creator>2Quiker</dc:creator>
      <dc:date>2020-09-11T22:44:53Z</dc:date>
    </item>
    <item>
      <title>Re: Update attributes of selected</title>
      <link>https://community.esri.com/t5/python-questions/update-attributes-of-selected/m-p/230914#M17898</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You have to cycle through the selection,&lt;/P&gt;&lt;P&gt;A couple of print statements would make it apparent whether you are getting just the first or just the last &lt;IMG src="https://community.esri.com/legacyfs/online/emoticons/wink.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 11 Sep 2020 23:14:13 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/update-attributes-of-selected/m-p/230914#M17898</guid>
      <dc:creator>DanPatterson</dc:creator>
      <dc:date>2020-09-11T23:14:13Z</dc:date>
    </item>
    <item>
      <title>Re: Update attributes of selected</title>
      <link>https://community.esri.com/t5/python-questions/update-attributes-of-selected/m-p/230915#M17899</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am having a hard time looping through the selections, I am not sure how to pass it to the rest of my code. Then again I am not sure my approach is the best...?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;ptCount &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; int&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;GetCount_management&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;ptSelection&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;getOutput&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;0&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;

dsc &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;Describe&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;ptSelection&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;     
selection_set &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; dsc&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;FIDSet             
&lt;SPAN class="keyword token"&gt;if&lt;/SPAN&gt; len&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;selection_set&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;==&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;0&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;"There are no features selected"&lt;/SPAN&gt;
             
&lt;SPAN class="keyword token"&gt;elif&lt;/SPAN&gt; ptCount &lt;SPAN class="operator token"&gt;&amp;gt;=&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;1&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;

    oidList &lt;SPAN class="operator token"&gt;=&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;with&lt;/SPAN&gt; arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;da&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;SearchCursor&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;ptSelection&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;'SHAPE@'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;'OID@'&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;as&lt;/SPAN&gt; cursor&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
        &lt;SPAN class="keyword token"&gt;for&lt;/SPAN&gt; row &lt;SPAN class="keyword token"&gt;in&lt;/SPAN&gt; cursor&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
            oidList&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;append&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;row&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;0&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
            oid &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; row&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;1&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;
            arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;AddMessage&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;oid&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="comment token"&gt;# does not print anything in window.&lt;/SPAN&gt;
            
    &lt;SPAN class="keyword token"&gt;del&lt;/SPAN&gt; cursor

    &lt;SPAN class="keyword token"&gt;for&lt;/SPAN&gt; OID &lt;SPAN class="keyword token"&gt;in&lt;/SPAN&gt; oidList&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
        arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;SelectLayerByLocation_management&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;parcel&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"INTERSECT"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;ptSelection&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"OBJECTID = {}"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;format&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;str&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;row&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;1&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&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;parcel&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"parcel_lyr"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; 

&lt;SPAN class="comment token"&gt;##next??‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍&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;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 11:13:14 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/update-attributes-of-selected/m-p/230915#M17899</guid>
      <dc:creator>2Quiker</dc:creator>
      <dc:date>2021-12-11T11:13:14Z</dc:date>
    </item>
    <item>
      <title>Re: Update attributes of selected</title>
      <link>https://community.esri.com/t5/python-questions/update-attributes-of-selected/m-p/230916#M17900</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;To assist in understanding your project, the goal is to update attributes in the well points layer with data from the parcels layer feature the well is located in, correct?&amp;nbsp; Does each parcel contain only one well or can it contain several wells?&amp;nbsp; Do you need to only update a few wells where the data is missing, or do you want to update all wells? Could you share some sample data?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 24 Sep 2020 20:45:57 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/update-attributes-of-selected/m-p/230916#M17900</guid>
      <dc:creator>RandyBurton</dc:creator>
      <dc:date>2020-09-24T20:45:57Z</dc:date>
    </item>
    <item>
      <title>Re: Update attributes of selected</title>
      <link>https://community.esri.com/t5/python-questions/update-attributes-of-selected/m-p/230917#M17901</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I tested the following code inside Desktop 10.5 with parcels and points layers in the map.&amp;nbsp; It may give you some ideas.&amp;nbsp; I did not use a where clause for the update cursor, but one could be used to limit the rows to ones where the Well ID is null or '' (zero length).&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;points &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"WellPoints"&lt;/SPAN&gt;
parcels &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"WellParcels"&lt;/SPAN&gt;

parcelFlds &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;'WellID'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'dept'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'type'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'Geothermal'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'GeoWaterUs'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'Temp'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'TempDate'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;
pointFlds &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;'W_ID'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'dept'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'type'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'Geothermal'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'GeoWaterUs'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'Temp'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'TempDate'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'SHAPE@'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;


&lt;SPAN class="keyword token"&gt;with&lt;/SPAN&gt; arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;da&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;UpdateCursor&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;points&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; pointFlds&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;as&lt;/SPAN&gt; cursor&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
    &lt;SPAN class="keyword token"&gt;for&lt;/SPAN&gt; row &lt;SPAN class="keyword token"&gt;in&lt;/SPAN&gt; cursor&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
        arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;management&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;SelectLayerByLocation&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;parcels&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"INTERSECT"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; row&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;7&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;&lt;SPAN class="punctuation 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="string token"&gt;"NEW_SELECTION"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
        &lt;SPAN class="keyword token"&gt;with&lt;/SPAN&gt; arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;da&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;SearchCursor&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;parcels&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; parcelFlds&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;as&lt;/SPAN&gt; parcelsCursor&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
            &lt;SPAN class="keyword token"&gt;for&lt;/SPAN&gt; parcelRow &lt;SPAN class="keyword token"&gt;in&lt;/SPAN&gt; parcelsCursor&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
                &lt;SPAN class="comment token"&gt;# print parcelRow&lt;/SPAN&gt;
                row&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;0&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; parcelRow&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;0&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;
                row&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;1&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; parcelRow&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;1&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;
                row&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;2&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; parcelRow&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;2&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;
                row&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;3&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; parcelRow&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;3&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;
                row&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;4&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; parcelRow&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;4&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;
                row&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;5&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; parcelRow&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;5&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;
                row&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;6&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; parcelRow&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;6&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;
                cursor&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;updateRow&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;row&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="comment token"&gt;# update row&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;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I also noticed a few typos in your code - perhaps copy/paste errors.&amp;nbsp; A missing comma and an extra space:&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="operator token"&gt;&amp;gt;&amp;gt;&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;&amp;gt;&lt;/SPAN&gt; fldList &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;'WellID'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'dept'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'type'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;' Geothermal'&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'GeoWaterUs'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'Temp'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'TempDate'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;
&lt;SPAN class="operator token"&gt;&amp;gt;&amp;gt;&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;&amp;gt;&lt;/SPAN&gt; fldList
&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;'WellID'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'dept'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'type'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;' GeothermalGeoWaterUs'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'Temp'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'TempDate'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;
&lt;SPAN class="operator token"&gt;&amp;gt;&amp;gt;&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;&amp;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;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Hope this helps.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 11:13:16 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/update-attributes-of-selected/m-p/230917#M17901</guid>
      <dc:creator>RandyBurton</dc:creator>
      <dc:date>2021-12-11T11:13:16Z</dc:date>
    </item>
    <item>
      <title>Re: Update attributes of selected</title>
      <link>https://community.esri.com/t5/python-questions/update-attributes-of-selected/m-p/230918#M17902</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Randy,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have attached the point and taxlots, I would like to update just the selected well points, maybe one or maybe 50, 100+, not all wells need to be updated just missing ones or the ones I select, some parcel may have more than one well. I am not sure if failed attempt to do it is the best and fastest way, maybe spatial join, also some records can have 0 or null, blanks...? The other question is there a way to update the fields on the points from the taxlots if they exist/match without having to type each field out? Thanks for the help Randy!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 25 Sep 2020 17:37:39 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/update-attributes-of-selected/m-p/230918#M17902</guid>
      <dc:creator>2Quiker</dc:creator>
      <dc:date>2020-09-25T17:37:39Z</dc:date>
    </item>
    <item>
      <title>Re: Update attributes of selected</title>
      <link>https://community.esri.com/t5/python-questions/update-attributes-of-selected/m-p/230919#M17903</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I did some testing with the data you provided using Desktop 10.5.&amp;nbsp;&amp;nbsp;&amp;nbsp; I did notice that the field names didn't match with what you were trying in your scripts, so that may be something to watch out for.&amp;nbsp; Here's a script for you to try, It uses your shape files, so you may need to make adjustments if you are using a file/server geodatabase.&amp;nbsp; It is basically the approach in my earlier post.&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="keyword token"&gt;import&lt;/SPAN&gt; arcpy

points &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"GeoWellTemp"&lt;/SPAN&gt; &lt;SPAN class="comment token"&gt;# layers in map&lt;/SPAN&gt;
parcels &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"WellTaxlots"&lt;/SPAN&gt;

&lt;SPAN class="comment token"&gt;# if outside ArcMap (or inside ArcMap with an empty document), add these extra steps&lt;/SPAN&gt;
ptsPath &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; r&lt;SPAN class="string token"&gt;'C:\Path\to\GeoWellTemp.shp'&lt;/SPAN&gt;
parPath &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; r&lt;SPAN class="string token"&gt;'C:\Path\to\WellTaxlots.shp'&lt;/SPAN&gt;
arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;MakeFeatureLayer_management&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;ptsPath&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; points&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;parPath&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; parcels&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&lt;SPAN class="comment token"&gt;# end extra steps&lt;/SPAN&gt;

&lt;SPAN class="comment token"&gt;# parcel and point fields are paired; geometry is added at end for points&lt;/SPAN&gt;
parcelFlds &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;'WellID'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'W_DEPTH'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'Geothermal'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'GeoWaterUs'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'TEMP'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'TEMP_DATE'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;
pointFlds &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;'WellID'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'W_DEPTH'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'Geothermal'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'GeoWaterUs'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'TEMP'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'TEMP_DATE'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'SHAPE@'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;

&lt;SPAN class="comment token"&gt;# clear any selected features&lt;/SPAN&gt;
arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;SelectLayerByAttribute_management&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;points&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"CLEAR_SELECTION"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;SelectLayerByAttribute_management&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;parcels&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"CLEAR_SELECTION"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;

where_clause &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'WellID IS NULL OR WellID = 0'&lt;/SPAN&gt; &lt;SPAN class="comment token"&gt;# where clause if needed&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;with&lt;/SPAN&gt; arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;da&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;UpdateCursor&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;points&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; pointFlds&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; where_clause&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;as&lt;/SPAN&gt; cursor&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
    &lt;SPAN class="keyword token"&gt;for&lt;/SPAN&gt; row &lt;SPAN class="keyword token"&gt;in&lt;/SPAN&gt; cursor&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
        &lt;SPAN class="comment token"&gt;# row[6] is the point's geometry - SHAPE@&lt;/SPAN&gt;
        arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;management&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;SelectLayerByLocation&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;parcels&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"INTERSECT"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; row&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;6&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;&lt;SPAN class="punctuation 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="string token"&gt;"NEW_SELECTION"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
        &lt;SPAN class="keyword token"&gt;with&lt;/SPAN&gt; arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;da&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;SearchCursor&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;parcels&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; parcelFlds&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;as&lt;/SPAN&gt; parcelsCursor&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
            &lt;SPAN class="keyword token"&gt;for&lt;/SPAN&gt; parcelRow &lt;SPAN class="keyword token"&gt;in&lt;/SPAN&gt; parcelsCursor&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
                &lt;SPAN class="comment token"&gt;# print parcelRow&lt;/SPAN&gt;
                row&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;0&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; parcelRow&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;0&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt; &lt;SPAN class="comment token"&gt;# WellID&lt;/SPAN&gt;
                row&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;1&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; parcelRow&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;1&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt; &lt;SPAN class="comment token"&gt;# W_DEPTH&lt;/SPAN&gt;
                row&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;2&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; parcelRow&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;2&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt; &lt;SPAN class="comment token"&gt;# Geothermal&lt;/SPAN&gt;
                row&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;3&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; parcelRow&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;3&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt; &lt;SPAN class="comment token"&gt;# GeoWaterUS&lt;/SPAN&gt;
                row&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;4&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; parcelRow&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;4&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt; &lt;SPAN class="comment token"&gt;# TEMP&lt;/SPAN&gt;
                row&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;5&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; parcelRow&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;5&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt; &lt;SPAN class="comment token"&gt;# TEMP_DATE&lt;/SPAN&gt;
                cursor&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;updateRow&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;row&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="comment token"&gt;# update row&lt;/SPAN&gt;

&lt;SPAN class="comment token"&gt;# last parcel selected can be cleared&lt;/SPAN&gt;
arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;SelectLayerByAttribute_management&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;parcels&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"CLEAR_SELECTION"&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;/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;P&gt;I'm not sure how fast this approach will be if you have lots of points to update.&amp;nbsp; I did some testing with a spatial join and field mapping.&amp;nbsp; I can share that approach, if you're interested.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 11:13:19 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/update-attributes-of-selected/m-p/230919#M17903</guid>
      <dc:creator>RandyBurton</dc:creator>
      <dc:date>2021-12-11T11:13:19Z</dc:date>
    </item>
    <item>
      <title>Re: Update attributes of selected</title>
      <link>https://community.esri.com/t5/python-questions/update-attributes-of-selected/m-p/230920#M17904</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Randy, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is very helpful thank you. If you don't mind sharing the spatial join and field mapping code that would be great.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 29 Sep 2020 14:40:58 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/update-attributes-of-selected/m-p/230920#M17904</guid>
      <dc:creator>2Quiker</dc:creator>
      <dc:date>2020-09-29T14:40:58Z</dc:date>
    </item>
    <item>
      <title>Re: Update attributes of selected</title>
      <link>https://community.esri.com/t5/python-questions/update-attributes-of-selected/m-p/230921#M17905</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Here's the approach I was experimenting with that uses a spatial join (and field mapping).&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="comment token"&gt;# inside ArcMap with layers in a map&lt;/SPAN&gt;
points &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"GeoWellTemp"&lt;/SPAN&gt;
parcels &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"WellTaxlots"&lt;/SPAN&gt;
&lt;SPAN class="comment token"&gt;# outside ArcMap, use full path to feature layer or shapefile&lt;/SPAN&gt;
&lt;SPAN class="comment token"&gt;# points = r'C:\Path\to\GeoWellTemp.shp'&lt;/SPAN&gt;
&lt;SPAN class="comment token"&gt;# parcels = r'C:\Path\to\WellTaxlots.shp'&lt;/SPAN&gt;

&lt;SPAN class="comment token"&gt;# fields needed for join (assumes field names exist)&lt;/SPAN&gt;
pointsFlds &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;'OBJECTID'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt; &lt;SPAN class="comment token"&gt;# alternatively use the FID field&lt;/SPAN&gt;
parcelFlds &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;'WellID'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'W_DEPTH'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'Geothermal'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'GeoWaterUs'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'TEMP'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'TEMP_DATE'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;

&lt;SPAN class="comment token"&gt;# set-up the field mappings&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;

&lt;SPAN class="comment token"&gt;# fields in target (points) layer are done first&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;for&lt;/SPAN&gt; f &lt;SPAN class="keyword token"&gt;in&lt;/SPAN&gt; pointsFlds&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; &lt;SPAN class="comment token"&gt;# field mapping for points layer&lt;/SPAN&gt;
    fm &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;FieldMap&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
    fm&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;addInputField&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;points&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; f&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
    fieldmappings&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;addFieldMap&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;fm&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;

&lt;SPAN class="comment token"&gt;# field mapping for points layer with same field names as parcels&lt;/SPAN&gt;
&lt;SPAN class="comment token"&gt;# these fields will be renamed to avoid confusion&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;for&lt;/SPAN&gt; f &lt;SPAN class="keyword token"&gt;in&lt;/SPAN&gt; parcelFlds&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; 
    &lt;SPAN class="keyword token"&gt;try&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
        fm &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;FieldMap&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="comment token"&gt;# reset field map&lt;/SPAN&gt;
        fm&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;addInputField&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;points&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; f&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="comment token"&gt;# checking points for matching field&lt;/SPAN&gt;
        outname &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; fm&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;outputField
        outname&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;name &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; outname&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;name &lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"_99"&lt;/SPAN&gt; &lt;SPAN class="comment token"&gt;# append _99 to end&lt;/SPAN&gt;
        outname&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;aliasName &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; outname&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;aliasName &lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"_99"&lt;/SPAN&gt;
        fm&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;outputField &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; outname
        fieldmappings&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;addFieldMap&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;fm&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
    &lt;SPAN class="keyword token"&gt;except&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
        &lt;SPAN class="keyword token"&gt;pass&lt;/SPAN&gt;

&lt;SPAN class="comment token"&gt;# then do fields in join (parcels) layer&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;for&lt;/SPAN&gt; f &lt;SPAN class="keyword token"&gt;in&lt;/SPAN&gt; parcelFlds&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; &lt;SPAN class="comment token"&gt;# field mapping for parcels layer&lt;/SPAN&gt;
    fm &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;FieldMap&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
    fm&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;addInputField&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;parcels&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; f&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
    fieldmappings&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;addFieldMap&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;fm&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;

&lt;SPAN class="comment token"&gt;# now the spatial join&lt;/SPAN&gt;
join &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'in_memory\sj_test'&lt;/SPAN&gt; &lt;SPAN class="comment token"&gt;# location/name of join&lt;/SPAN&gt;

&lt;SPAN class="keyword token"&gt;if&lt;/SPAN&gt; arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;Exists&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;join&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;  &lt;SPAN class="comment token"&gt;# delete any old joins&lt;/SPAN&gt;
    arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;Delete_management&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;join&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;

&lt;SPAN class="comment token"&gt;# join one to many will create a JOIN_FID which with the TARGET_FID could be used in checking the linking of the features&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; points&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; join_features &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; parcels&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; out_feature_class &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; join&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_MANY"&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_ALL"&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;

joinFlds &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; pointsFlds &lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt; parcelFlds &lt;SPAN class="comment token"&gt;# points fields has the objectid or fid field &lt;/SPAN&gt;
valueDict &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;r&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;0&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;r&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;1&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&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;for&lt;/SPAN&gt; r &lt;SPAN class="keyword token"&gt;in&lt;/SPAN&gt; arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;da&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;SearchCursor&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;join&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; joinFlds&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;

&lt;SPAN class="comment token"&gt;# update the points feature&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;with&lt;/SPAN&gt; arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;da&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;UpdateCursor&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;points&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; joinFlds&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;as&lt;/SPAN&gt; updateRows&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
    &lt;SPAN class="keyword token"&gt;for&lt;/SPAN&gt; updateRow &lt;SPAN class="keyword token"&gt;in&lt;/SPAN&gt; updateRows&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
        keyValue &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; updateRow&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;0&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;
        &lt;SPAN class="keyword token"&gt;if&lt;/SPAN&gt; keyValue &lt;SPAN class="keyword token"&gt;in&lt;/SPAN&gt; valueDict&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
            &lt;SPAN class="keyword token"&gt;for&lt;/SPAN&gt; n &lt;SPAN class="keyword token"&gt;in&lt;/SPAN&gt; range &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;1&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;len&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;joinFlds&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
                updateRow&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;n&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; valueDict&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;keyValue&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;n&lt;SPAN class="number token"&gt;-1&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;
            updateRows&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;updateRow&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;updateRow&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;

&lt;SPAN class="comment token"&gt;# clean up&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;if&lt;/SPAN&gt; arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;Exists&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;join&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
    arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;Delete_management&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;join&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;

&lt;SPAN class="keyword token"&gt;del&lt;/SPAN&gt; valueDict‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍&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;/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;P&gt;&lt;/P&gt;&lt;P&gt;The field mappings took some experimenting.&amp;nbsp; I first tried a spatial join and examined the code the tool creates (copy as python snippet).&amp;nbsp; This provided a way to examine the default field map the tool generates.&amp;nbsp; The points and parcels layers had a number of fields that used the same name. Normally, the target feature (points, in this case) would use the original field name, and the join feature (parcels) would append an underscore with a number to rename any fields sharing a name in the target feature.&amp;nbsp; As I wanted the original field names for the join feature, I renamed the target feature's fields when setting up the field mapping.&amp;nbsp; I think the identical names caused some issues for the spatial join tool, as it would use the values of the target feature when I selected only the fields from the join feature.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I ended up performing three steps to assemble the field map.&amp;nbsp; First, I selected the object id field from the target feature to be used for linking to the points feature.&amp;nbsp; The second step was to select and rename any fields in the target feature that had identical names in the join feature that were to be used.&amp;nbsp; The final step was to select the fields in the join feature that were used to update the points feature.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I used an in_memory location for the spatial join; it needed to be a temporary join anyway.&amp;nbsp; I used a 'one to many' join to have access to the JOIN_FID field that is created which would assist in linking the two layers together for any debugging necessary.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The last steps were to load the join layer's data into a dictionary and to use it in an update cursor.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think this approach is a bit faster than the one in my previous post.&amp;nbsp; But it took much more time to get debugged and working.&amp;nbsp; Hope this helps.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 11:13:22 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/update-attributes-of-selected/m-p/230921#M17905</guid>
      <dc:creator>RandyBurton</dc:creator>
      <dc:date>2021-12-11T11:13:22Z</dc:date>
    </item>
    <item>
      <title>Re: Update attributes of selected</title>
      <link>https://community.esri.com/t5/python-questions/update-attributes-of-selected/m-p/230922#M17906</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for sharing Randy,&amp;nbsp;The code worked great for the data I attached but after hours it took me a while to figure out that my original data had fields that quite didn't match the taxlots fields.&amp;nbsp;So it's my fault for not providing the correct data I was trying to cut down the data size and I apologize. For example, the points have fieldA, field1, field2, field3 and the point taxlots have field_A, field_1, field_2, field_3.&amp;nbsp; The code works great if I only need those field but like I mentioned I need something that will also include fields that don't match.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So for the fields that don't match I need to transfer&lt;/P&gt;&lt;P&gt;field_A --&amp;gt; fieldA&lt;/P&gt;&lt;P&gt;field_1 --&amp;gt; field1&lt;/P&gt;&lt;P&gt;field_2 --&amp;gt; field1&lt;/P&gt;&lt;P&gt;field_3 --&amp;gt; field1&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 01 Oct 2020 22:20:56 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/update-attributes-of-selected/m-p/230922#M17906</guid>
      <dc:creator>2Quiker</dc:creator>
      <dc:date>2020-10-01T22:20:56Z</dc:date>
    </item>
  </channel>
</rss>

