<?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: Publish simple tool with calculate in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/publish-simple-tool-with-calculate/m-p/575931#M45138</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Mody,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can you provide us more information like,&lt;/P&gt;&lt;P&gt;ArcGIS server installed on which OS?&lt;/P&gt;&lt;P&gt;Is there only issue with this GP process?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;From first look like is related to selection on labeling.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 25 Apr 2017 09:45:07 GMT</pubDate>
    <dc:creator>Anonymous User</dc:creator>
    <dc:date>2017-04-25T09:45:07Z</dc:date>
    <item>
      <title>Publish simple tool with calculate</title>
      <link>https://community.esri.com/t5/python-questions/publish-simple-tool-with-calculate/m-p/575928#M45135</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello all&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a one line python script that looks like this:&lt;/P&gt;&lt;P&gt;arcpy.CalculateField_management(r"DemandPoints1","from1",'"aaa"',"PYTHON_9.3")&lt;/P&gt;&lt;P&gt;from1 is a text field in&amp;nbsp;&lt;SPAN&gt;DemandPoints1 and I would like to put the value aaa in it.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;This script runs with no problem as tool (no parameters) in ArcMap but when I try to publish it as geoprocessing service I get:&lt;/SPAN&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;SPAN&gt;24046: Tool &amp;lt;value&amp;gt; cannot use VB expressions for services
There are many examples of complex calculations but I would like to make it simple!!
Any ideas?&lt;/SPAN&gt;&lt;/PRE&gt;&lt;DIV&gt;&lt;DIV class=""&gt;&lt;H1 id="toc-hId-1933604429"&gt;&lt;/H1&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 16:38:39 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/publish-simple-tool-with-calculate/m-p/575928#M45135</guid>
      <dc:creator>ModyBuchbinder</dc:creator>
      <dc:date>2021-12-12T16:38:39Z</dc:date>
    </item>
    <item>
      <title>Re: Publish simple tool with calculate</title>
      <link>https://community.esri.com/t5/python-questions/publish-simple-tool-with-calculate/m-p/575929#M45136</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;exclamation marks for fields when using python ie !FieldName! could be the issue&lt;/P&gt;&lt;P&gt;&lt;A href="http://desktop.arcgis.com/en/arcmap/latest/tools/data-management-toolbox/calculate-field-examples.htm"&gt;http://desktop.arcgis.com/en/arcmap/latest/tools/data-management-toolbox/calculate-field-examples.htm&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 25 Apr 2017 08:04:19 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/publish-simple-tool-with-calculate/m-p/575929#M45136</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2017-04-25T08:04:19Z</dc:date>
    </item>
    <item>
      <title>Re: Publish simple tool with calculate</title>
      <link>https://community.esri.com/t5/python-questions/publish-simple-tool-with-calculate/m-p/575930#M45137</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I know that! I need to put a VALUE not a field value.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 25 Apr 2017 08:07:50 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/publish-simple-tool-with-calculate/m-p/575930#M45137</guid>
      <dc:creator>ModyBuchbinder</dc:creator>
      <dc:date>2017-04-25T08:07:50Z</dc:date>
    </item>
    <item>
      <title>Re: Publish simple tool with calculate</title>
      <link>https://community.esri.com/t5/python-questions/publish-simple-tool-with-calculate/m-p/575931#M45138</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Mody,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can you provide us more information like,&lt;/P&gt;&lt;P&gt;ArcGIS server installed on which OS?&lt;/P&gt;&lt;P&gt;Is there only issue with this GP process?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;From first look like is related to selection on labeling.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 25 Apr 2017 09:45:07 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/publish-simple-tool-with-calculate/m-p/575931#M45138</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2017-04-25T09:45:07Z</dc:date>
    </item>
    <item>
      <title>Re: Publish simple tool with calculate</title>
      <link>https://community.esri.com/t5/python-questions/publish-simple-tool-with-calculate/m-p/575932#M45139</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am using ArcGIS Server 10.3.1 on windows.&lt;/P&gt;&lt;P&gt;The tool is published and works. It just gives warning (level High) when I analyse before publishing.&lt;/P&gt;&lt;P&gt;Looks like a bug to me.&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 25 Apr 2017 10:08:40 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/publish-simple-tool-with-calculate/m-p/575932#M45139</guid>
      <dc:creator>ModyBuchbinder</dc:creator>
      <dc:date>2017-04-25T10:08:40Z</dc:date>
    </item>
    <item>
      <title>Re: Publish simple tool with calculate</title>
      <link>https://community.esri.com/t5/python-questions/publish-simple-tool-with-calculate/m-p/575933#M45140</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ohh&lt;BR /&gt;&lt;BR /&gt;Thanks for the information.&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 25 Apr 2017 11:00:19 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/publish-simple-tool-with-calculate/m-p/575933#M45140</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2017-04-25T11:00:19Z</dc:date>
    </item>
    <item>
      <title>Re: Publish simple tool with calculate</title>
      <link>https://community.esri.com/t5/python-questions/publish-simple-tool-with-calculate/m-p/575934#M45141</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;it is a warning as documented here&amp;nbsp;&lt;A href="http://server.arcgis.com/en/server/latest/publish-services/windows/24046-tool-cannot-use-vb-expressions-for-services.htm"&gt;http://server.arcgis.com/en/server/latest/publish-services/windows/24046-tool-cannot-use-vb-expressions-for-services.htm&lt;/A&gt; and&amp;nbsp;&lt;A href="http://support.esri.com/Search-Results#search?q=24046"&gt;http://support.esri.com/Search-Results#search?q=24046&lt;/A&gt; for more&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 25 Apr 2017 11:31:37 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/publish-simple-tool-with-calculate/m-p/575934#M45141</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2017-04-25T11:31:37Z</dc:date>
    </item>
    <item>
      <title>Re: Publish simple tool with calculate</title>
      <link>https://community.esri.com/t5/python-questions/publish-simple-tool-with-calculate/m-p/575935#M45142</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Dan&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks, as usual you are correct.&lt;/P&gt;&lt;P&gt;They only problem is that I do not have any VB expression in my python code.&lt;/P&gt;&lt;P&gt;That is why I think it is a bug.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 25 Apr 2017 11:49:41 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/publish-simple-tool-with-calculate/m-p/575935#M45142</guid>
      <dc:creator>ModyBuchbinder</dc:creator>
      <dc:date>2017-04-25T11:49:41Z</dc:date>
    </item>
    <item>
      <title>Re: Publish simple tool with calculate</title>
      <link>https://community.esri.com/t5/python-questions/publish-simple-tool-with-calculate/m-p/575936#M45143</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Which is why I pointed it out... it said to ignore it if you don't have a vb expression or to fix it if you do.&amp;nbsp; Confusing needless to say, but perhaps the simple example that you were testing is too simple and 'it' thinks it is vb.. perhaps try something more complicated (well not really) but is truly python...&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;"{}".format("aaa")&lt;/STRONG&gt; which of course yields &lt;STRONG&gt;'aaa'&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 25 Apr 2017 11:58:30 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/publish-simple-tool-with-calculate/m-p/575936#M45143</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2017-04-25T11:58:30Z</dc:date>
    </item>
    <item>
      <title>Re: Publish simple tool with calculate</title>
      <link>https://community.esri.com/t5/python-questions/publish-simple-tool-with-calculate/m-p/575937#M45144</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;After running the tool in ArcMap, if you go to Geoprocessing &amp;gt; Results and right-click on Calculate Field and select Copy As Python Snippet, it produces the following code:&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="comment token"&gt;# ArcMap 10.2.1 - Fails, doesn't like """"aaa""""&lt;/SPAN&gt;
arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;CalculateField_management&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"DemandPoints1"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"from1"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;""""aaa"""&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;","&lt;/SPAN&gt;PYTHON_9&lt;SPAN class="number token"&gt;.3&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;","&lt;/SPAN&gt;&lt;SPAN class="comment token"&gt;#")&lt;/SPAN&gt;

&lt;SPAN class="comment token"&gt;# ArcMap 10.5 - Success&lt;/SPAN&gt;
arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;CalculateField_management&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;in_table&lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"DemandPoints1"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; field&lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"from1"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; expression&lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"'aaa'"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; expression_type&lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"PYTHON_9.3"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; code_block&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;‍‍‍&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;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Here are&amp;nbsp;other variations I have&amp;nbsp;tried:&amp;nbsp;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;CalculateField_management&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"DemandPoints1"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"from1"&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;format&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"aaa"&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;"PYTHON_9.3"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;"&lt;SPAN class="comment token"&gt;#") # fails&lt;/SPAN&gt;

arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;CalculateField_management&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"DemandPoints1"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"from1"&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;format&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"'aaa'"&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;"PYTHON_9.3"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;"&lt;SPAN class="comment token"&gt;#") # success&lt;/SPAN&gt;

arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;CalculateField_management&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"DemandPoints1"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"from1"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;'aaa'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"PYTHON_9.3"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;"&lt;SPAN class="comment token"&gt;#") # fails&lt;/SPAN&gt;

arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;CalculateField_management&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"DemandPoints1"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"from1"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"aaa"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"PYTHON_9.3"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;"&lt;SPAN class="comment token"&gt;#") # fails&lt;/SPAN&gt;

arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;CalculateField_management&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"DemandPoints1"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"from1"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"'aaa'"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"PYTHON_9.3"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;"&lt;SPAN class="comment token"&gt;#") # success‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍&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;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 00:47:53 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/publish-simple-tool-with-calculate/m-p/575937#M45144</guid>
      <dc:creator>RandyBurton</dc:creator>
      <dc:date>2021-12-12T00:47:53Z</dc:date>
    </item>
  </channel>
</rss>

