<?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: GP service input parameter converted from string to integer when called from browser in Geoprocessing Questions</title>
    <link>https://community.esri.com/t5/geoprocessing-questions/gp-service-input-parameter-converted-from-string/m-p/688150#M22822</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This is a pretty big problem for me as well. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 04 Apr 2016 23:48:00 GMT</pubDate>
    <dc:creator>PhilLarkin</dc:creator>
    <dc:date>2016-04-04T23:48:00Z</dc:date>
    <item>
      <title>GP service input parameter converted from string to integer when called from browser</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/gp-service-input-parameter-converted-from-string/m-p/688147#M22819</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I have a 10.1 GP service task based on a Python script. At the top of the script I grab the input parameters, e.g.,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;myId = arcpy.GetParameterAsText(0)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;myId2 = arcpy.GetParameterAsText(1)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The parameters are all defined as String type in the Properties of the script within the ArcGIS toolbox. The second parameter has a format along the lines of 01207.000. We need this full string including leading zeroes and trailing digits.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;When I use ArcMap/Catalog to run this GP service task, the parameters get read correctly and the script runs fine. However, when I run this task from the Services Directory, the second parameter has its format converted to 1207, i.e., leading and trailing zeroes are dropped, as if it's been parsed to an integer. This happens even when running the task from a browser on the server using port 6080.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have used a packet sniffer (Wireshark) to confirm that the full format is being sent to the server. And in the script I've used arcpy.AddMessage to display the value as read by the script. In the Services Directory case that shows it is receiving the parameter in integer format.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Is there some reason the value would be getting converted between the browser and the script?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 07 Nov 2012 22:05:05 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/gp-service-input-parameter-converted-from-string/m-p/688147#M22819</guid>
      <dc:creator>BryanBaker</dc:creator>
      <dc:date>2012-11-07T22:05:05Z</dc:date>
    </item>
    <item>
      <title>Re: GP service input parameter converted from string to integer when called from brow</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/gp-service-input-parameter-converted-from-string/m-p/688148#M22820</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I'll have to test this.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I remember this was a bug during 10.1 beta cycle - I just looked it up and its set to fixed.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I'll see if its somehow come back or popping up in a different way.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 08 Nov 2012 14:39:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/gp-service-input-parameter-converted-from-string/m-p/688148#M22820</guid>
      <dc:creator>KevinHibma</dc:creator>
      <dc:date>2012-11-08T14:39:42Z</dc:date>
    </item>
    <item>
      <title>Re: GP service input parameter converted from string to integer when called from brow</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/gp-service-input-parameter-converted-from-string/m-p/688149#M22821</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Any news on this one? It's gotten to be a bigger issue with us.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;thanks,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Bryan &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;(Note: I am no longer with ESRI. I have asked the forum moderator to remove my ESRI logo.)&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 13 Jan 2013 23:35:16 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/gp-service-input-parameter-converted-from-string/m-p/688149#M22821</guid>
      <dc:creator>BryanBaker</dc:creator>
      <dc:date>2013-01-13T23:35:16Z</dc:date>
    </item>
    <item>
      <title>Re: GP service input parameter converted from string to integer when called from browser</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/gp-service-input-parameter-converted-from-string/m-p/688150#M22822</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This is a pretty big problem for me as well. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 04 Apr 2016 23:48:00 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/gp-service-input-parameter-converted-from-string/m-p/688150#M22822</guid>
      <dc:creator>PhilLarkin</dc:creator>
      <dc:date>2016-04-04T23:48:00Z</dc:date>
    </item>
    <item>
      <title>Re: GP service input parameter converted from string to integer when called from browser</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/gp-service-input-parameter-converted-from-string/m-p/688151#M22823</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try this:&lt;/P&gt;&lt;PRE __default_attr="python" __jive_macro_name="code" class="jive_macro_code jive_text_macro _jivemacro_uid_1459965254249634" data-renderedposition="34_8_1332_16" jivemacro_uid="_1459965254249634" modifiedtitle="true"&gt;&lt;P&gt;&lt;SPAN style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif; color: #3d3d3d;"&gt;str(arcpy.GetParameterAsText(1))&lt;/SPAN&gt;&lt;/P&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 Apr 2016 17:54:47 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/gp-service-input-parameter-converted-from-string/m-p/688151#M22823</guid>
      <dc:creator>AndrewKeith3</dc:creator>
      <dc:date>2016-04-06T17:54:47Z</dc:date>
    </item>
  </channel>
</rss>

