<?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 arcpy.da.SearchCursor error 'tuple' object has no attribute 'getValue' in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/python-arcpy-da-searchcursor-error-tuple-object/m-p/97994#M7622</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Jose,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You need to reference the fields using their list index.&amp;nbsp; For example, if AGMID is the 1st field, and DIGIDATE is the 3rd field, your code would be:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;for rowYesterday in curYesterday:&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; agreementID = rowYesterday[0] 
&amp;nbsp;&amp;nbsp;&amp;nbsp; datetimeVal = rowYesterday[2]
&amp;nbsp;&amp;nbsp;&amp;nbsp; print agreementID&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; print datetimeVal&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 11 Dec 2021 06:07:55 GMT</pubDate>
    <dc:creator>JakeSkinner</dc:creator>
    <dc:date>2021-12-11T06:07:55Z</dc:date>
    <item>
      <title>Python arcpy.da.SearchCursor error 'tuple' object has no attribute 'getValue'</title>
      <link>https://community.esri.com/t5/python-questions/python-arcpy-da-searchcursor-error-tuple-object/m-p/97990#M7618</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello everyone,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am changing in my program the arcpy.SearchCursor&amp;nbsp; to arcpy.da.SearchCursor and when I run the code I am getting the following error message:&lt;/P&gt;&lt;P&gt;Python Error occurred&lt;/P&gt;&lt;P&gt;'tuple' object has no attribute 'getValue'&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;&amp;nbsp; # Get field objects from source FC AGREEMENT
&amp;nbsp; #
&amp;nbsp; dsc = arcpy.Describe(AGREEMENT)
&amp;nbsp; fields = dsc.fields
&amp;nbsp; #
&amp;nbsp; # List all field names except the OID field
&amp;nbsp; #
&amp;nbsp; fieldnamesYesterday = [field.name for field in fields if field.name != dsc.OIDFieldName]


&amp;nbsp; curYesterday = arcpy.da.SearchCursor(AGREEMENT, fieldnamesYesterday)



&amp;nbsp; for&amp;nbsp; rowYesterday in curYesterday:


&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; agreementID = rowYesterday.getValue("AGMID")
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; datetimeVal = rowYesterday.getValue("DIGIDATE")
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; print agreementID
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; print datetimeVal


&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 06:07:52 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-arcpy-da-searchcursor-error-tuple-object/m-p/97990#M7618</guid>
      <dc:creator>JoseSanchez</dc:creator>
      <dc:date>2021-12-11T06:07:52Z</dc:date>
    </item>
    <item>
      <title>Re: Python arcpy.da.SearchCursor error 'tuple' object has no attribute 'getValue'</title>
      <link>https://community.esri.com/t5/python-questions/python-arcpy-da-searchcursor-error-tuple-object/m-p/97991#M7619</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;indentation errors if that is what you have&lt;/P&gt;&lt;P&gt;&lt;A href="http://desktop.arcgis.com/en/arcmap/10.3/analyze/python/data-access-using-cursors.htm" title="http://desktop.arcgis.com/en/arcmap/10.3/analyze/python/data-access-using-cursors.htm"&gt;Accessing data using cursors—Help | ArcGIS for Desktop&lt;/A&gt; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 04 Mar 2016 13:52:18 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-arcpy-da-searchcursor-error-tuple-object/m-p/97991#M7619</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2016-03-04T13:52:18Z</dc:date>
    </item>
    <item>
      <title>Re: Python arcpy.da.SearchCursor error 'tuple' object has no attribute 'getValue'</title>
      <link>https://community.esri.com/t5/python-questions/python-arcpy-da-searchcursor-error-tuple-object/m-p/97992#M7620</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This is a matter of simply reading the help files. The two different cursors use different syntax.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;First read this:&lt;/P&gt;&lt;P&gt;&lt;A href="http://resources.arcgis.com/en/help/main/10.2/#/SearchCursor/018w00000011000000/" title="http://resources.arcgis.com/en/help/main/10.2/#/SearchCursor/018w00000011000000/"&gt;ArcGIS Help (10.2, 10.2.1, and 10.2.2)&lt;/A&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then read this:&lt;/P&gt;&lt;P&gt;&lt;A href="http://resources.arcgis.com/en/help/main/10.2/index.html#//002z0000001q000000" title="http://resources.arcgis.com/en/help/main/10.2/index.html#//002z0000001q000000"&gt;ArcGIS Help (10.2, 10.2.1, and 10.2.2)&lt;/A&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This will answer your question.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 04 Mar 2016 13:54:59 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-arcpy-da-searchcursor-error-tuple-object/m-p/97992#M7620</guid>
      <dc:creator>RuthBowers</dc:creator>
      <dc:date>2016-03-04T13:54:59Z</dc:date>
    </item>
    <item>
      <title>Re: Python arcpy.da.SearchCursor error 'tuple' object has no attribute 'getValue'</title>
      <link>https://community.esri.com/t5/python-questions/python-arcpy-da-searchcursor-error-tuple-object/m-p/97993#M7621</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello everyone,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am following this sample to list all the fields:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://gis.stackexchange.com/questions/90372/using-arcpy-da-insertcursor-to-insert-an-entire-row-that-is-fetched-from-a-searc" title="http://gis.stackexchange.com/questions/90372/using-arcpy-da-insertcursor-to-insert-an-entire-row-that-is-fetched-from-a-searc"&gt;Using arcpy.da.InsertCursor to insert an entire row that is fetched from a search cursor? - Geographic Information Syste…&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What is wrong with my code, could you please be more specific.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 04 Mar 2016 14:09:26 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-arcpy-da-searchcursor-error-tuple-object/m-p/97993#M7621</guid>
      <dc:creator>JoseSanchez</dc:creator>
      <dc:date>2016-03-04T14:09:26Z</dc:date>
    </item>
    <item>
      <title>Re: Python arcpy.da.SearchCursor error 'tuple' object has no attribute 'getValue'</title>
      <link>https://community.esri.com/t5/python-questions/python-arcpy-da-searchcursor-error-tuple-object/m-p/97994#M7622</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Jose,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You need to reference the fields using their list index.&amp;nbsp; For example, if AGMID is the 1st field, and DIGIDATE is the 3rd field, your code would be:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;for rowYesterday in curYesterday:&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; agreementID = rowYesterday[0] 
&amp;nbsp;&amp;nbsp;&amp;nbsp; datetimeVal = rowYesterday[2]
&amp;nbsp;&amp;nbsp;&amp;nbsp; print agreementID&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; print datetimeVal&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 06:07:55 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-arcpy-da-searchcursor-error-tuple-object/m-p/97994#M7622</guid>
      <dc:creator>JakeSkinner</dc:creator>
      <dc:date>2021-12-11T06:07:55Z</dc:date>
    </item>
    <item>
      <title>Re: Python arcpy.da.SearchCursor error 'tuple' object has no attribute 'getValue'</title>
      <link>https://community.esri.com/t5/python-questions/python-arcpy-da-searchcursor-error-tuple-object/m-p/97995#M7623</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The samples from ESRI always show a hardcoded list of fields &lt;SPAN class="p"&gt;[&lt;/SPAN&gt;&lt;SPAN class="s"&gt;'fieldA'&lt;/SPAN&gt;&lt;SPAN class="p"&gt;,&lt;/SPAN&gt; &lt;SPAN class="s"&gt;'fieldB'&lt;/SPAN&gt;&lt;SPAN class="p"&gt;&lt;/SPAN&gt;]&amp;nbsp; but in my case I need to read all the fields from the feature class, and list them in the "field_names" parameter.&lt;/P&gt;&lt;P&gt;&lt;SPAN class="arcpyref"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="arcpyref"&gt;arcpy.da.&lt;A class="xref" href="http://resources.arcgis.com/en/help/main/10.2/018w/018w00000011000000.htm" rel="/en/help/main/10.2/018w/018w00000011000000.htm"&gt;SearchCursor&lt;/A&gt;(in_table, field_names, {where_clause}, {spatial_reference}, {explode_to_points}, {sql_clause})&lt;/SPAN&gt; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 04 Mar 2016 14:19:02 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-arcpy-da-searchcursor-error-tuple-object/m-p/97995#M7623</guid>
      <dc:creator>JoseSanchez</dc:creator>
      <dc:date>2016-03-04T14:19:02Z</dc:date>
    </item>
    <item>
      <title>Re: Python arcpy.da.SearchCursor error 'tuple' object has no attribute 'getValue'</title>
      <link>https://community.esri.com/t5/python-questions/python-arcpy-da-searchcursor-error-tuple-object/m-p/97996#M7624</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;See example 2 &lt;A href="http://desktop.arcgis.com/en/arcmap/10.3/analyze/arcpy-functions/listfields.htm" title="http://desktop.arcgis.com/en/arcmap/10.3/analyze/arcpy-functions/listfields.htm"&gt;ListFields—Help | ArcGIS for Desktop&lt;/A&gt; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 07 Mar 2016 20:15:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-arcpy-da-searchcursor-error-tuple-object/m-p/97996#M7624</guid>
      <dc:creator>WesMiller</dc:creator>
      <dc:date>2016-03-07T20:15:04Z</dc:date>
    </item>
    <item>
      <title>Re: Python arcpy.da.SearchCursor error 'tuple' object has no attribute 'getValue'</title>
      <link>https://community.esri.com/t5/python-questions/python-arcpy-da-searchcursor-error-tuple-object/m-p/97997#M7625</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Here is the code you need:&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;# Get field objects from source FC AGREEMENT&amp;nbsp; 
#&amp;nbsp; 
dsc = arcpy.Describe(AGREEMENT)&amp;nbsp; 
fields = dsc.fields&amp;nbsp; 
#&amp;nbsp; 
# List all field names except the OID field&amp;nbsp; 
#&amp;nbsp; 
fieldnamesYesterday = [field.name for field in fields if field.name != dsc.OIDFieldName]&amp;nbsp; 

curYesterday = arcpy.da.SearchCursor(AGREEMENT, fieldnamesYesterday)&amp;nbsp; 

for rowYesterday in curYesterday:&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; agreementID = rowYesterday[fieldnamesYesterday.index("AGMID")]&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; datetimeVal = rowYesterday[fieldnamesYesterday.index("DIGIDATE")]&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; print agreementID&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; print datetimeVal&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 06:07:58 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-arcpy-da-searchcursor-error-tuple-object/m-p/97997#M7625</guid>
      <dc:creator>AndrewKeith3</dc:creator>
      <dc:date>2021-12-11T06:07:58Z</dc:date>
    </item>
    <item>
      <title>Re: Python arcpy.da.SearchCursor error 'tuple' object has no attribute 'getValue'</title>
      <link>https://community.esri.com/t5/python-questions/python-arcpy-da-searchcursor-error-tuple-object/m-p/97998#M7626</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Are you following the code in the SE thread because that is what you are doing, i.e., inserting records from one dataset into another, or are you using the code just for its general structure?&amp;nbsp; If the former, it might be quicker to use either the &lt;A href="http://desktop.arcgis.com/en/arcmap/latest/tools/data-management-toolbox/copy-features.htm"&gt;Copy Features&lt;/A&gt; tool or &lt;A href="http://desktop.arcgis.com/en/arcmap/latest/tools/data-management-toolbox/append.htm"&gt;Append &lt;/A&gt;tool.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 07 Apr 2016 21:01:58 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-arcpy-da-searchcursor-error-tuple-object/m-p/97998#M7626</guid>
      <dc:creator>JoshuaBixby</dc:creator>
      <dc:date>2016-04-07T21:01:58Z</dc:date>
    </item>
  </channel>
</rss>

