<?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: Item not found in this collection error - UpdateCursor on Query Table in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/item-not-found-in-this-collection-error/m-p/232446#M18002</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You mention "query table."&amp;nbsp; Are you using Make Query Table or Make Query Layer?&amp;nbsp; Make Query Table is powerful, but it is an older tool, and I am not sure if its outputs are editable.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I just did a quick test using Make Query Table where I took a single feature class and used Make Query Table to create a layer, so this is a very simple case without multiple data sets or joins.&amp;nbsp; Although I could use an update cursor on the feature class directly, I could not use it on the layer created from Make Query Table.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 28 Jan 2015 17:06:58 GMT</pubDate>
    <dc:creator>JoshuaBixby</dc:creator>
    <dc:date>2015-01-28T17:06:58Z</dc:date>
    <item>
      <title>Item not found in this collection error - UpdateCursor on Query Table</title>
      <link>https://community.esri.com/t5/python-questions/item-not-found-in-this-collection-error/m-p/232441#M17997</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The following code:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;with arcpy.da.UpdateCursor("QueryTable", ("SHAPE", "leakage_with_pon_list_Eastings", "leakage_with_pon_list_Northings", "leakage_with_pon_list_RandomNumber")) as cursor:
&amp;nbsp; for row in cursor:
&amp;nbsp; row[1] = row[0].positionAlongLine(row[3], True).X
&amp;nbsp; row[2] = row[0].positionAlongLine(row[3], True).Y

&amp;nbsp; cursor.updateRow(row)&lt;/PRE&gt;&lt;P&gt;fails with an "item not found in this collection" error, apparently on line 02. Is it not possible to use an update cursor on a query table or something?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 11:45:14 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/item-not-found-in-this-collection-error/m-p/232441#M17997</guid>
      <dc:creator>DanEvans</dc:creator>
      <dc:date>2021-12-11T11:45:14Z</dc:date>
    </item>
    <item>
      <title>Re: Item not found in this collection error - UpdateCursor on Query Table</title>
      <link>https://community.esri.com/t5/python-questions/item-not-found-in-this-collection-error/m-p/232442#M17998</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Although I don't think this is related to the error, it looks like your indentation is off on lines 03 and 04.&amp;nbsp; Not sure if the code itself is that way or just a copy &amp;amp; paste problem into the text box.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can you post the specific error output, all of it?&amp;nbsp; Knowing the line of the error is helpful, but usually additional information is output that is also helpful.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 28 Jan 2015 16:27:35 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/item-not-found-in-this-collection-error/m-p/232442#M17998</guid>
      <dc:creator>JoshuaBixby</dc:creator>
      <dc:date>2015-01-28T16:27:35Z</dc:date>
    </item>
    <item>
      <title>Re: Item not found in this collection error - UpdateCursor on Query Table</title>
      <link>https://community.esri.com/t5/python-questions/item-not-found-in-this-collection-error/m-p/232443#M17999</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The indentation is correct in the script, must just be a copy and paste problem.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The full text of the error is:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Traceback (most recent call last):&lt;/P&gt;&lt;P&gt;&amp;nbsp; File "D:\Design_Layer_Tools\Leakage\Code\ValidateLeakage.py", line 93, in &amp;lt;module&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; for row in cursor:&lt;/P&gt;&lt;P&gt;RuntimeError: Item not found in this collection.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;(Line 93 = Line 02 of the code segment I posted).&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 28 Jan 2015 16:32:01 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/item-not-found-in-this-collection-error/m-p/232443#M17999</guid>
      <dc:creator>DanEvans</dc:creator>
      <dc:date>2015-01-28T16:32:01Z</dc:date>
    </item>
    <item>
      <title>Re: Item not found in this collection error - UpdateCursor on Query Table</title>
      <link>https://community.esri.com/t5/python-questions/item-not-found-in-this-collection-error/m-p/232444#M18000</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Change this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;with arcpy.da.UpdateCursor(&lt;SPAN class="string"&gt;"QueryTable", [&lt;SPAN class="string"&gt;"SHAPE"&lt;/SPAN&gt;, &lt;SPAN class="string"&gt;"leakage_with_pon_list_Eastings"&lt;/SPAN&gt;, &lt;SPAN class="string"&gt;"leakage_with_pon_list_Northings"&lt;/SPAN&gt;, &lt;SPAN class="string"&gt;"leakage_with_pon_list_RandomNumber"]&lt;/SPAN&gt;) as cursor:&amp;nbsp; &lt;/SPAN&gt;
&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;or to this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;flds = [&lt;SPAN class="string"&gt;"SHAPE"&lt;/SPAN&gt;, &lt;SPAN class="string"&gt;"leakage_with_pon_list_Eastings"&lt;/SPAN&gt;, &lt;SPAN class="string"&gt;"leakage_with_pon_list_Northings"&lt;/SPAN&gt;, &lt;SPAN class="string"&gt;"leakage_with_pon_list_RandomNumber"&lt;/SPAN&gt;]&lt;SPAN class="string"&gt;&lt;/SPAN&gt;
with arcpy.da.UpdateCursor(&lt;SPAN class="string"&gt;"QueryTable", flds) as cursor:&amp;nbsp; &lt;/SPAN&gt;
&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="string"&gt;(Edits applied above)&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 11:45:16 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/item-not-found-in-this-collection-error/m-p/232444#M18000</guid>
      <dc:creator>JamesCrandall</dc:creator>
      <dc:date>2021-12-11T11:45:16Z</dc:date>
    </item>
    <item>
      <title>Re: Item not found in this collection error - UpdateCursor on Query Table</title>
      <link>https://community.esri.com/t5/python-questions/item-not-found-in-this-collection-error/m-p/232445#M18001</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Although using lists for field names is much more common, tuples are supported.&amp;nbsp; I am leaning more towards the query table.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 28 Jan 2015 16:54:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/item-not-found-in-this-collection-error/m-p/232445#M18001</guid>
      <dc:creator>JoshuaBixby</dc:creator>
      <dc:date>2015-01-28T16:54:06Z</dc:date>
    </item>
    <item>
      <title>Re: Item not found in this collection error - UpdateCursor on Query Table</title>
      <link>https://community.esri.com/t5/python-questions/item-not-found-in-this-collection-error/m-p/232446#M18002</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You mention "query table."&amp;nbsp; Are you using Make Query Table or Make Query Layer?&amp;nbsp; Make Query Table is powerful, but it is an older tool, and I am not sure if its outputs are editable.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I just did a quick test using Make Query Table where I took a single feature class and used Make Query Table to create a layer, so this is a very simple case without multiple data sets or joins.&amp;nbsp; Although I could use an update cursor on the feature class directly, I could not use it on the layer created from Make Query Table.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 28 Jan 2015 17:06:58 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/item-not-found-in-this-collection-error/m-p/232446#M18002</guid>
      <dc:creator>JoshuaBixby</dc:creator>
      <dc:date>2015-01-28T17:06:58Z</dc:date>
    </item>
    <item>
      <title>Re: Item not found in this collection error - UpdateCursor on Query Table</title>
      <link>https://community.esri.com/t5/python-questions/item-not-found-in-this-collection-error/m-p/232447#M18003</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I struggle with this type of stuff because python is so finicky with specifics and I never know what I can get away with &lt;IMG src="https://community.esri.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 28 Jan 2015 18:37:37 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/item-not-found-in-this-collection-error/m-p/232447#M18003</guid>
      <dc:creator>JamesCrandall</dc:creator>
      <dc:date>2015-01-28T18:37:37Z</dc:date>
    </item>
  </channel>
</rss>

