<?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: Calculate Field Syntax Error in ModelBuilder, what am I doing wrong? in Geoprocessing Questions</title>
    <link>https://community.esri.com/t5/geoprocessing-questions/calculate-field-syntax-error-in-modelbuilder-what/m-p/261392#M8973</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Solved it! I used " instead ' around %Name% and it appears to be working. Thanks for the help everyone.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 13 Apr 2017 18:20:41 GMT</pubDate>
    <dc:creator>ShaneShepherd</dc:creator>
    <dc:date>2017-04-13T18:20:41Z</dc:date>
    <item>
      <title>Calculate Field Syntax Error in ModelBuilder, what am I doing wrong?</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/calculate-field-syntax-error-in-modelbuilder-what/m-p/261386#M8967</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi everyone,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Very new to ModelBuilder - I am trying to use ModelBuilder to add a field called “Survey_ID” then populate that field using Calculate Field to use the last 6 characters of the filename for a group of feature classes. The Iterate Feature Classes and Add Field options seem to be working, but my Calculate Field expression seems to be incorrect. Here is the error I get when I run the model:&lt;/P&gt;&lt;P style="margin-left: 7.5pt;"&gt;&lt;SPAN style="font-size: 11.5pt; color: #404040;"&gt;Executing (Calculate Field): CalculateField "O:\DCF\Test HerringAS Geodatabase.gdb\HAS_Photo_0325_201702" Survey_ID Right('HAS_Photo_0325_201702', 6) VB #&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-left: 7.5pt;"&gt;&lt;SPAN style="font-size: 11.5pt; color: black;"&gt;Start Time: Thu Apr 13 09:16:24 2017&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-left: 7.5pt;"&gt;&lt;SPAN style="font-size: 11.5pt; color: green;"&gt;General error executing calculator.&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-left: 7.5pt;"&gt;&lt;SPAN style="font-size: 11.5pt; color: #d70019;"&gt;ERROR &lt;/SPAN&gt;&lt;SPAN style="font-size: 11.5pt; color: #28f28b;"&gt;999999&lt;/SPAN&gt;&lt;SPAN style="font-size: 11.5pt; color: #d70019;"&gt;: Error executing function.&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-left: 7.5pt;"&gt;&lt;SPAN style="font-size: 11.5pt; color: #d70019;"&gt;Syntax error&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-left: 7.5pt;"&gt;&lt;SPAN style="font-size: 11.5pt; color: #d70019;"&gt;Failed to execute (Calculate Field).&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For the Calculate Field I hit the Calculator icon, and in the box for Survey_ID = I use this expression: Right('%Name%', 6)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any idea what I’m doing wrong here?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks so much for any assistance!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 13 Apr 2017 17:27:33 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/calculate-field-syntax-error-in-modelbuilder-what/m-p/261386#M8967</guid>
      <dc:creator>ShaneShepherd</dc:creator>
      <dc:date>2017-04-13T17:27:33Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate Field Syntax Error in ModelBuilder, what am I doing wrong?</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/calculate-field-syntax-error-in-modelbuilder-what/m-p/261387#M8968</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;An initial observation is that it appears that the Geodatabase has spaces in the name.&amp;nbsp; If that is the case, see if you can change the Geodatabase name using underscores instead of spaces.&amp;nbsp; There are quite a few processes in GIS that choke when a space is used in a filename or folder name, and unfortunately there is not a helpful error message that pops up to notify the user of this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also, a question.&amp;nbsp; Does the same issue occur if one does the Calculate Field manually?&amp;nbsp; In other words, does it work when done manually, but does not work when employed through Modelbuilder?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Chris Donohue, GISP&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 13 Apr 2017 17:46:01 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/calculate-field-syntax-error-in-modelbuilder-what/m-p/261387#M8968</guid>
      <dc:creator>ChrisDonohue__GISP</dc:creator>
      <dc:date>2017-04-13T17:46:01Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate Field Syntax Error in ModelBuilder, what am I doing wrong?</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/calculate-field-syntax-error-in-modelbuilder-what/m-p/261388#M8969</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I tried renaming the Geodatabase and I get a "Failed to rename object" error. It's interesting that the Add Field works fine, but the Calculate Field doesn't since they both reference the same Geodatabase.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 13 Apr 2017 17:49:21 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/calculate-field-syntax-error-in-modelbuilder-what/m-p/261388#M8969</guid>
      <dc:creator>ShaneShepherd</dc:creator>
      <dc:date>2017-04-13T17:49:21Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate Field Syntax Error in ModelBuilder, what am I doing wrong?</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/calculate-field-syntax-error-in-modelbuilder-what/m-p/261389#M8970</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Solved the rename issue with the Geodatabase, but still receiving the syntax error on the Calculate Field.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 13 Apr 2017 17:58:35 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/calculate-field-syntax-error-in-modelbuilder-what/m-p/261389#M8970</guid>
      <dc:creator>ShaneShepherd</dc:creator>
      <dc:date>2017-04-13T17:58:35Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate Field Syntax Error in ModelBuilder, what am I doing wrong?</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/calculate-field-syntax-error-in-modelbuilder-what/m-p/261390#M8971</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Shane,&amp;nbsp; to mention a few of the things I mention in the email (that Chris hasn't already)&lt;/P&gt;&lt;P&gt;"... &lt;SPAN style="color: #1f497d;"&gt;Do you have write permissions to the featureclass/table?&amp;nbsp; Is the field able to accept a string format?&amp;nbsp; Maybe you need to convert the result of Right() to a value.&amp;nbsp; Also, make sure all your CaSe is correct.&amp;nbsp; I think VB might be more forgiving, but python is not.&lt;/SPAN&gt;"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;edit: tagging &lt;A href="https://community.esri.com/groups/model-builder?sr=search&amp;amp;searchId=295e6fc7-372b-4211-a594-f08f7103541d&amp;amp;searchIndex=0"&gt;https://community.esri.com/groups/model-builder?sr=search&amp;amp;searchId=295e6fc7-372b-4211-a594-f08f7103541d&amp;amp;searchIndex=0&lt;/A&gt;‌&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 13 Apr 2017 18:04:45 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/calculate-field-syntax-error-in-modelbuilder-what/m-p/261390#M8971</guid>
      <dc:creator>RebeccaStrauch__GISP</dc:creator>
      <dc:date>2017-04-13T18:04:45Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate Field Syntax Error in ModelBuilder, what am I doing wrong?</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/calculate-field-syntax-error-in-modelbuilder-what/m-p/261391#M8972</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;We can move the discussion here instead of email so anyone who might be able to assist is privy to all the information, good idea. From my recent email:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #1f497d;"&gt;I renamed the Geodatabase to take the spaces out but I’m still receiving the syntax error. Even though the end result of the Field would be a 6 digit number, I have the Add Field set up to make it a Text field so that it can accept strings. I am able to edit the table and make changes so I believe my write permissions are ok.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #1f497d;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #1f497d;"&gt;I would try a manual entry using field calculator outside of the model, but I’m not sure how to get the field calculator to reference the filename when it is not a field in the table nor an inline variable in ModelBuilder.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 13 Apr 2017 18:09:25 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/calculate-field-syntax-error-in-modelbuilder-what/m-p/261391#M8972</guid>
      <dc:creator>ShaneShepherd</dc:creator>
      <dc:date>2017-04-13T18:09:25Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate Field Syntax Error in ModelBuilder, what am I doing wrong?</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/calculate-field-syntax-error-in-modelbuilder-what/m-p/261392#M8973</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Solved it! I used " instead ' around %Name% and it appears to be working. Thanks for the help everyone.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 13 Apr 2017 18:20:41 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/calculate-field-syntax-error-in-modelbuilder-what/m-p/261392#M8973</guid>
      <dc:creator>ShaneShepherd</dc:creator>
      <dc:date>2017-04-13T18:20:41Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate Field Syntax Error in ModelBuilder, what am I doing wrong?</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/calculate-field-syntax-error-in-modelbuilder-what/m-p/261393#M8974</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;….glad you got it fixed….i in geonet, remember to close out your thread by maybe comments that are helpful, and the one that is correct.   You don’t get points for marking your own, but still probably the best one to mark. Other option is to mark it as assumed answered.  Same point results, but both let others know it was resolved.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Geonet etiquette.  ☺&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 13 Apr 2017 18:24:47 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/calculate-field-syntax-error-in-modelbuilder-what/m-p/261393#M8974</guid>
      <dc:creator>RebeccaStrauch__GISP</dc:creator>
      <dc:date>2017-04-13T18:24:47Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate Field Syntax Error in ModelBuilder, what am I doing wrong?</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/calculate-field-syntax-error-in-modelbuilder-what/m-p/261394#M8975</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;A better solution is to use Python!&amp;nbsp;&lt;IMG src="https://community.esri.com/legacyfs/online/emoticons/happy.png" /&gt;&amp;nbsp; A side benefit is this (besides Python being awesome) will allow your model to run in Pro ( VBScript is not supported in 64 bit.) Use the PYTHON_9.3 parser and this syntax, either single or double quotes:&lt;/P&gt;&lt;PRE class="language-python line-numbers"&gt;&lt;CODE&gt;&lt;SPAN class="string token"&gt;"%Name%"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="operator 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="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>Mon, 17 Apr 2017 23:50:39 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/calculate-field-syntax-error-in-modelbuilder-what/m-p/261394#M8975</guid>
      <dc:creator>curtvprice</dc:creator>
      <dc:date>2017-04-17T23:50:39Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate Field Syntax Error in ModelBuilder, what am I doing wrong?</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/calculate-field-syntax-error-in-modelbuilder-what/m-p/261395#M8976</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Python definitely seems like a skillset I want to develop, when I've got some more time to devote to studying I plan to do so. Thanks for the help!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 18 Apr 2017 17:00:55 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/calculate-field-syntax-error-in-modelbuilder-what/m-p/261395#M8976</guid>
      <dc:creator>ShaneShepherd</dc:creator>
      <dc:date>2017-04-18T17:00:55Z</dc:date>
    </item>
  </channel>
</rss>

