<?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 Update date field in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/update-date-field/m-p/614928#M47976</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm pretty new to python and I have a table in a geodatabase that contains info on data sources, names, targets and a date field. I have a script that copies features based on a user's input, e.g. if ft_ID ==1. then copy features. I want to update the date field based on the affected/copied features row that the "copy features" was executed, and I don't know how to. (e/g. If I copy feature with ID as "1", update the corresponding date field for today/whatever day I copy that field). I just know I may need to use an update cursor.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I was playing around with the update cursor, but only got it to work to update current date for all features.&amp;nbsp;This is how it looks like so far.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;DIV style="color: #d4d4d4; background-color: #1e1e1e; font-weight: normal; font-size: 14px;"&gt;&lt;DIV&gt;&lt;SPAN style="color: #d4d4d4;"&gt;LYR_UPDATE_TABLE &lt;/SPAN&gt;&lt;SPAN style="color: #d4d4d4;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="color: #d4d4d4;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #569cd6;"&gt;r&lt;/SPAN&gt;&lt;SPAN style="color: #d16969;"&gt;".\...gdb&lt;/SPAN&gt;&lt;SPAN style="color: #d7ba7d;"&gt;\L&lt;/SPAN&gt;&lt;SPAN style="color: #d16969;"&gt;ayer_Update"&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN style="color: #608b4e;"&gt;#FIELD_NAMES = ['a', 'b', 'c',&amp;nbsp; 'LastUpdate']&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN style="color: #d4d4d4;"&gt;fld &lt;/SPAN&gt;&lt;SPAN style="color: #d4d4d4;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="color: #d4d4d4;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #ce9178;"&gt;'LastUpdate'&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV style="color: #d4d4d4; background-color: #1e1e1e; font-weight: normal;"&gt;&lt;DIV&gt;&lt;SPAN style="color: #608b4e;"&gt;btch_num = raw_input ("Please enter ID: ")&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;DIV style="font-weight: normal;"&gt;&lt;DIV style="background-color: #1e1e1e; font-weight: normal;"&gt;&lt;DIV&gt;&lt;SPAN style="color: #c586c0;"&gt;with&lt;/SPAN&gt;&lt;SPAN&gt; arcpy.da.UpdateCursor (LYR_UPDATE_TABLE, fld) &lt;/SPAN&gt;&lt;SPAN style="color: #c586c0;"&gt;as&lt;/SPAN&gt;&lt;SPAN&gt; dt_cursor:&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="color: #c586c0;"&gt;for&lt;/SPAN&gt;&lt;SPAN&gt; row &lt;/SPAN&gt;&lt;SPAN style="color: #569cd6;"&gt;in&lt;/SPAN&gt;&lt;SPAN&gt; dt_cursor:&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="color: #608b4e;"&gt;# btch_id was defined earlier as the user's input to choose the features to cpy from the table&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="color: #c586c0;"&gt;if&lt;/SPAN&gt;&lt;SPAN&gt; batch_id &lt;/SPAN&gt;&lt;SPAN&gt;==&lt;/SPAN&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #4ec9b0;"&gt;int&lt;/SPAN&gt;&lt;SPAN&gt;(btch_num):&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="color: #608b4e;"&gt;#Update the LastUpdate field with the date of the copy features-update&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="color: #ce9178;"&gt;"""row [6] = (...)"""&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;dt_cursor.updateRow([datetime.date.today()])&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="color: #dcdcaa;"&gt;print&lt;/SPAN&gt;&lt;SPAN&gt; (&lt;/SPAN&gt;&lt;SPAN style="color: #ce9178;"&gt;'date Update Success!'&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 29 Jan 2018 23:00:12 GMT</pubDate>
    <dc:creator>LauraBusolo2</dc:creator>
    <dc:date>2018-01-29T23:00:12Z</dc:date>
    <item>
      <title>Update date field</title>
      <link>https://community.esri.com/t5/python-questions/update-date-field/m-p/614928#M47976</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm pretty new to python and I have a table in a geodatabase that contains info on data sources, names, targets and a date field. I have a script that copies features based on a user's input, e.g. if ft_ID ==1. then copy features. I want to update the date field based on the affected/copied features row that the "copy features" was executed, and I don't know how to. (e/g. If I copy feature with ID as "1", update the corresponding date field for today/whatever day I copy that field). I just know I may need to use an update cursor.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I was playing around with the update cursor, but only got it to work to update current date for all features.&amp;nbsp;This is how it looks like so far.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;DIV style="color: #d4d4d4; background-color: #1e1e1e; font-weight: normal; font-size: 14px;"&gt;&lt;DIV&gt;&lt;SPAN style="color: #d4d4d4;"&gt;LYR_UPDATE_TABLE &lt;/SPAN&gt;&lt;SPAN style="color: #d4d4d4;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="color: #d4d4d4;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #569cd6;"&gt;r&lt;/SPAN&gt;&lt;SPAN style="color: #d16969;"&gt;".\...gdb&lt;/SPAN&gt;&lt;SPAN style="color: #d7ba7d;"&gt;\L&lt;/SPAN&gt;&lt;SPAN style="color: #d16969;"&gt;ayer_Update"&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN style="color: #608b4e;"&gt;#FIELD_NAMES = ['a', 'b', 'c',&amp;nbsp; 'LastUpdate']&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN style="color: #d4d4d4;"&gt;fld &lt;/SPAN&gt;&lt;SPAN style="color: #d4d4d4;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="color: #d4d4d4;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #ce9178;"&gt;'LastUpdate'&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV style="color: #d4d4d4; background-color: #1e1e1e; font-weight: normal;"&gt;&lt;DIV&gt;&lt;SPAN style="color: #608b4e;"&gt;btch_num = raw_input ("Please enter ID: ")&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;DIV style="font-weight: normal;"&gt;&lt;DIV style="background-color: #1e1e1e; font-weight: normal;"&gt;&lt;DIV&gt;&lt;SPAN style="color: #c586c0;"&gt;with&lt;/SPAN&gt;&lt;SPAN&gt; arcpy.da.UpdateCursor (LYR_UPDATE_TABLE, fld) &lt;/SPAN&gt;&lt;SPAN style="color: #c586c0;"&gt;as&lt;/SPAN&gt;&lt;SPAN&gt; dt_cursor:&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="color: #c586c0;"&gt;for&lt;/SPAN&gt;&lt;SPAN&gt; row &lt;/SPAN&gt;&lt;SPAN style="color: #569cd6;"&gt;in&lt;/SPAN&gt;&lt;SPAN&gt; dt_cursor:&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="color: #608b4e;"&gt;# btch_id was defined earlier as the user's input to choose the features to cpy from the table&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="color: #c586c0;"&gt;if&lt;/SPAN&gt;&lt;SPAN&gt; batch_id &lt;/SPAN&gt;&lt;SPAN&gt;==&lt;/SPAN&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #4ec9b0;"&gt;int&lt;/SPAN&gt;&lt;SPAN&gt;(btch_num):&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="color: #608b4e;"&gt;#Update the LastUpdate field with the date of the copy features-update&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="color: #ce9178;"&gt;"""row [6] = (...)"""&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;dt_cursor.updateRow([datetime.date.today()])&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="color: #dcdcaa;"&gt;print&lt;/SPAN&gt;&lt;SPAN&gt; (&lt;/SPAN&gt;&lt;SPAN style="color: #ce9178;"&gt;'date Update Success!'&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 29 Jan 2018 23:00:12 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/update-date-field/m-p/614928#M47976</guid>
      <dc:creator>LauraBusolo2</dc:creator>
      <dc:date>2018-01-29T23:00:12Z</dc:date>
    </item>
    <item>
      <title>Re: Update date field based on row edited</title>
      <link>https://community.esri.com/t5/python-questions/update-date-field/m-p/614929#M47977</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Are you getting an error, is so, what?&amp;nbsp; Provide the whole traceback.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 30 Jan 2018 02:51:02 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/update-date-field/m-p/614929#M47977</guid>
      <dc:creator>JoshuaBixby</dc:creator>
      <dc:date>2018-01-30T02:51:02Z</dc:date>
    </item>
    <item>
      <title>Re: Update date field based on row edited</title>
      <link>https://community.esri.com/t5/python-questions/update-date-field/m-p/614930#M47978</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The error was:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ValueError: need more than 1 value to unpack&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 30 Jan 2018 03:30:47 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/update-date-field/m-p/614930#M47978</guid>
      <dc:creator>LauraBusolo2</dc:creator>
      <dc:date>2018-01-30T03:30:47Z</dc:date>
    </item>
    <item>
      <title>Re: Update date field based on row edited</title>
      <link>https://community.esri.com/t5/python-questions/update-date-field/m-p/614931#M47979</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Usually the error will also indicate a line number and the module where the script had problems.&amp;nbsp; The complete error message block would help.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the meantime, you might try something like:&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;LYR_UPDATE_TABLE &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; r&lt;SPAN class="string token"&gt;"C:\Path\to\file.gdb\Layer_Update"&lt;/SPAN&gt;

fld &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'LastUpdate'&lt;/SPAN&gt;

btch_num &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; raw_input&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"Please enter a valid Batch ID: "&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="comment token"&gt;#assuming you are outside arcmap&lt;/SPAN&gt;

where_clause &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"batch_id = '{}'"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;format&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;btch_num&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="comment token"&gt;# where will limit to matching rows&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;LYR_UPDATE_TABLE&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; fld&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; dt_cursor&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="keyword token"&gt;for&lt;/SPAN&gt; row &lt;SPAN class="keyword token"&gt;in&lt;/SPAN&gt; dt_cursor&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 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; datetime&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;datetime&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;strftime&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;datetime&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;date&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;today&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="string token"&gt;"%Y-%m-%d"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; dt_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="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;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;I am assuming you are using a file geodatabase, and working outside ArcMap.&amp;nbsp; You can limit the rows in the cursor with a where clause.&amp;nbsp; Line 11 shows how you can format your date.&amp;nbsp; Hope this helps.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edit:&lt;/P&gt;&lt;P&gt;For the where clause, if the field type is numeric, omit the single quotes around the field value:&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;where_clause &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"batch_id = {}"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;format&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;btch_num&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="comment token"&gt;# where will limit to matching rows&lt;/SPAN&gt;
&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 02:18:03 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/update-date-field/m-p/614931#M47979</guid>
      <dc:creator>RandyBurton</dc:creator>
      <dc:date>2021-12-12T02:18:03Z</dc:date>
    </item>
    <item>
      <title>Re: Update date field based on row edited</title>
      <link>https://community.esri.com/t5/python-questions/update-date-field/m-p/614932#M47980</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The error is related to the line with the row.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;See below:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;File "testscript.py", line 16, in &amp;lt;module&amp;gt;&lt;BR /&gt; batch_id, source_path, source_name, target_path, target_name, method, last_update= row&amp;nbsp; #This is line 16, which reflects variables for the field names in the table&lt;BR /&gt;ValueError: need more than 1 value to unpack&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 30 Jan 2018 07:13:01 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/update-date-field/m-p/614932#M47980</guid>
      <dc:creator>LauraBusolo2</dc:creator>
      <dc:date>2018-01-30T07:13:01Z</dc:date>
    </item>
    <item>
      <title>Re: Update date field based on row edited</title>
      <link>https://community.esri.com/t5/python-questions/update-date-field/m-p/614933#M47981</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;from this line&lt;/P&gt;&lt;P&gt;&lt;SPAN style="display: inline !important; float: none; background-color: transparent; color: #3d3d3d; font-family: arial,helvetica,'helvetica neue',verdana,sans-serif; font-size: 15px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px;"&gt;batch_id, source_path, source_name, target_path, target_name, method, last_update= row&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="display: inline !important; float: none; background-color: transparent; color: #3d3d3d; font-family: arial,helvetica,'helvetica neue',verdana,sans-serif; font-size: 15px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px;"&gt;7 values were expected... row .... provided 1. which I suspect was empty.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="display: inline !important; float: none; background-color: transparent; color: #3d3d3d; font-family: arial,helvetica,'helvetica neue',verdana,sans-serif; font-size: 15px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px;"&gt;As a check, put...&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="display: inline !important; float: none; background-color: transparent; color: #3d3d3d; font-family: arial,helvetica,'helvetica neue',verdana,sans-serif; font-size: 15px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px;"&gt;print(row) immediately before that line and see if it prints out 7 values, if not, then there is something wrong with the input data.&amp;nbsp; Certainly there is something wrong with the code logic since that case should be checked for and accounted for in the script&lt;/SPAN&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;row &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &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="number token"&gt;2&lt;/SPAN&gt;&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="number token"&gt;4&lt;/SPAN&gt;&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="number token"&gt;6&lt;/SPAN&gt;&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;

a&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; b&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; c&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; d&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; e&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; f&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; g &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; row

&lt;SPAN class="keyword token"&gt;print&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="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="number token"&gt;2&lt;/SPAN&gt;&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="number token"&gt;4&lt;/SPAN&gt;&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="number token"&gt;6&lt;/SPAN&gt;&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="keyword token"&gt;print&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;a&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; b&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; c&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; d&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; e&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; f&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; g&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&lt;SPAN class="number token"&gt;1&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;2&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;3&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;4&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;5&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;6&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;7&lt;/SPAN&gt;

row &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &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="number token"&gt;2&lt;/SPAN&gt;&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;# ---- how to check&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;if&lt;/SPAN&gt; len&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;row&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;==&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;7&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="keyword token"&gt;print&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;'good'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;else&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="keyword token"&gt;print&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;'not enough values{}'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;format&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;row&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&lt;SPAN class="operator token"&gt;not&lt;/SPAN&gt; enough values&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="number token"&gt;2&lt;/SPAN&gt;&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="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;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 02:18:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/update-date-field/m-p/614933#M47981</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2021-12-12T02:18:06Z</dc:date>
    </item>
    <item>
      <title>Re: Update date field based on row edited</title>
      <link>https://community.esri.com/t5/python-questions/update-date-field/m-p/614934#M47982</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;As a side note... if you enable editor tracking&amp;nbsp;ArcGIS will maintain a date field and editor field to store the last edit:&amp;nbsp;&lt;A class="link-titled" href="http://pro.arcgis.com/en/pro-app/tool-reference/data-management/enable-editor-tracking.htm" title="http://pro.arcgis.com/en/pro-app/tool-reference/data-management/enable-editor-tracking.htm"&gt;Enable Editor Tracking—Data Management toolbox | ArcGIS Desktop&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 30 Jan 2018 12:54:16 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/update-date-field/m-p/614934#M47982</guid>
      <dc:creator>XanderBakker</dc:creator>
      <dc:date>2018-01-30T12:54:16Z</dc:date>
    </item>
    <item>
      <title>Re: Update date field based on row edited</title>
      <link>https://community.esri.com/t5/python-questions/update-date-field/m-p/614935#M47983</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You created the update cursor with a single field, i.e., &lt;SPAN style="font-family: courier\ new, courier, monospace;"&gt;fld&lt;/SPAN&gt;.&amp;nbsp;&amp;nbsp; In Line 16, you are trying to unpack a single item tuple into 7 different variables, hance the error that you need more than 1 value to unpack.&amp;nbsp; Instead of passing &lt;SPAN style="font-family: courier\ new, courier, monospace;"&gt;fld&lt;/SPAN&gt; to the cursor, pass &lt;SPAN style="font-family: courier\ new, courier, monospace;"&gt;FIELD_NAMES&lt;/SPAN&gt;.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 30 Jan 2018 15:00:35 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/update-date-field/m-p/614935#M47983</guid>
      <dc:creator>JoshuaBixby</dc:creator>
      <dc:date>2018-01-30T15:00:35Z</dc:date>
    </item>
    <item>
      <title>Re: Update date field based on row edited</title>
      <link>https://community.esri.com/t5/python-questions/update-date-field/m-p/614936#M47984</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;In the field list (commented out) you have "BatchID"&amp;nbsp; and in your code you are testing with "&lt;SPAN style="color: #c586c0;"&gt;if&lt;/SPAN&gt;&lt;SPAN&gt; batch_id &lt;/SPAN&gt;&lt;SPAN&gt;==&lt;/SPAN&gt;&lt;SPAN&gt; ..."&amp;nbsp; If these are field names, they are not the same field.&amp;nbsp; Did you mean them to be the same?&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 30 Jan 2018 17:15:18 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/update-date-field/m-p/614936#M47984</guid>
      <dc:creator>RandyBurton</dc:creator>
      <dc:date>2018-01-30T17:15:18Z</dc:date>
    </item>
  </channel>
</rss>

