<?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: Python script with user input options not working in geoprocessing service in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/python-script-with-user-input-options-not-working/m-p/1030888#M60136</link>
    <description>&lt;P&gt;So, I see where you are getting the dates, but I do not see you use them anywhere in your code.&amp;nbsp; Are you using them in your sql query? Have you tried with a default value from the script and not from the geoprocessing service input?&lt;/P&gt;&lt;LI-CODE lang="python"&gt;# sets a default if the parameter comes back empty or None
stdate_param = arcpy.GetParameterAsText(1)
if stdate_param == '#' or not stdate_param:
    stdate_param = '2020-05-01'&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;and here, you are concatenating the strings together&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;query1 = "some sql query for mandatory inputs"
    ###################################################
      ifelse condition lader for optional user inputs
    ###################################################
    if sectioncode_param != '':
        query1 = query1 + "and sectionCode = '"+sectioncode_param+"'"&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;will make your query1 end up like:&lt;/P&gt;&lt;P&gt;"some sql query for mandatory inputs and sectionCode = '"+sectioncode_param+"'"&lt;/P&gt;&lt;P&gt;Unless you took it out to post on the forum since you mentioned that it works as a script...&lt;/P&gt;&lt;P&gt;Last thing I can think of as is, can the server you have this process on use the myDB connection (username/password, SSO, etc)- i.e., its not tied to your login so it only works when you are logged in?&lt;/P&gt;</description>
    <pubDate>Fri, 26 Feb 2021 04:47:01 GMT</pubDate>
    <dc:creator>Anonymous User</dc:creator>
    <dc:date>2021-02-26T04:47:01Z</dc:date>
    <item>
      <title>Python script with user input options not working in geoprocessing service</title>
      <link>https://community.esri.com/t5/python-questions/python-script-with-user-input-options-not-working/m-p/1029954#M60086</link>
      <description>&lt;P&gt;Hi,&amp;nbsp; we are using arcgis 10.4 and server also same.&lt;/P&gt;&lt;P&gt;We have created a arcpy script with From_date, To_date options with additional two parameters for user to enter.&amp;nbsp; In local machine and in server machine it is running, when we run in arcpy window.&lt;/P&gt;&lt;P&gt;But when it is published as service, it is taking time and with out any error it publishes.&lt;/P&gt;&lt;P&gt;when we run it with parameter, it shows message submitted...executing then it fails, giving the error ESRI type error, with out any time lag.&lt;/P&gt;&lt;P&gt;Is it possible to debug this gp service while running, how to put the checks to know where I am failing.&lt;/P&gt;&lt;P&gt;Kindly suggest.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 24 Feb 2021 12:40:11 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-script-with-user-input-options-not-working/m-p/1029954#M60086</guid>
      <dc:creator>JayakumarPD</dc:creator>
      <dc:date>2021-02-24T12:40:11Z</dc:date>
    </item>
    <item>
      <title>Re: Python script with user input options not working in geoprocessing service</title>
      <link>https://community.esri.com/t5/python-questions/python-script-with-user-input-options-not-working/m-p/1029967#M60087</link>
      <description>&lt;P&gt;How exactly are the inputs being implemented? In the script itself with &lt;STRONG&gt;input()&lt;/STRONG&gt;? Or are you using the script input options from w/in the program?&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jcarlson_0-1614172959448.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/6769i1E07283DB99CFDE2/image-size/medium?v=v2&amp;amp;px=400" role="button" title="jcarlson_0-1614172959448.png" alt="jcarlson_0-1614172959448.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 24 Feb 2021 13:22:40 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-script-with-user-input-options-not-working/m-p/1029967#M60087</guid>
      <dc:creator>jcarlson</dc:creator>
      <dc:date>2021-02-24T13:22:40Z</dc:date>
    </item>
    <item>
      <title>Re: Python script with user input options not working in geoprocessing service</title>
      <link>https://community.esri.com/t5/python-questions/python-script-with-user-input-options-not-working/m-p/1030003#M60089</link>
      <description>&lt;P&gt;Same as jcarlson is saying, also give more info, your code, your parameters etc.&lt;/P&gt;&lt;P&gt;Check the arcgis server log, query-&amp;gt;debug etc.&lt;/P&gt;</description>
      <pubDate>Wed, 24 Feb 2021 14:47:59 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-script-with-user-input-options-not-working/m-p/1030003#M60089</guid>
      <dc:creator>DavidPike</dc:creator>
      <dc:date>2021-02-24T14:47:59Z</dc:date>
    </item>
    <item>
      <title>Re: Python script with user input options not working in geoprocessing service</title>
      <link>https://community.esri.com/t5/python-questions/python-script-with-user-input-options-not-working/m-p/1030345#M60109</link>
      <description>&lt;P&gt;This is the code for reference&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;PRE&gt;&lt;SPAN&gt;import &lt;/SPAN&gt;arcpy&lt;BR /&gt;&lt;SPAN&gt;import &lt;/SPAN&gt;os&lt;BR /&gt;&lt;SPAN&gt;import &lt;/SPAN&gt;arcgisscripting&lt;BR /&gt;gp = arcgisscripting.create()&lt;BR /&gt;&lt;BR /&gt;arcpy.env.workspace = &lt;SPAN&gt;"C:&lt;/SPAN&gt;&lt;SPAN&gt;\\&lt;/SPAN&gt;&lt;SPAN&gt;Users&lt;/SPAN&gt;&lt;SPAN&gt;\\&lt;/SPAN&gt;&lt;SPAN&gt;saslam&lt;/SPAN&gt;&lt;SPAN&gt;\\&lt;/SPAN&gt;&lt;SPAN&gt;AppData&lt;/SPAN&gt;&lt;SPAN&gt;\\&lt;/SPAN&gt;&lt;SPAN&gt;Roaming&lt;/SPAN&gt;&lt;SPAN&gt;\\&lt;/SPAN&gt;&lt;SPAN&gt;ESRI&lt;/SPAN&gt;&lt;SPAN&gt;\\&lt;/SPAN&gt;&lt;SPAN&gt;Desktop10.4&lt;/SPAN&gt;&lt;SPAN&gt;\\&lt;/SPAN&gt;&lt;SPAN&gt;ArcCatalog"&lt;BR /&gt;&lt;/SPAN&gt;myDB = &lt;SPAN&gt;"Database Connections&lt;/SPAN&gt;&lt;SPAN&gt;\\alias&lt;/SPAN&gt;&lt;SPAN&gt;_name__server_ip_adress.sde"  &lt;/SPAN&gt;&lt;SPAN&gt;# sde file for database connection&lt;BR /&gt;&lt;/SPAN&gt;sqlConn = arcpy.ArcSDESQLExecute(myDB)&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;# fetching parameters from gui&lt;BR /&gt;&lt;/SPAN&gt;rangecode_param = &lt;SPAN&gt;''&lt;BR /&gt;&lt;/SPAN&gt;stdate_param = &lt;SPAN&gt;''&lt;BR /&gt;&lt;/SPAN&gt;eddate_param = &lt;SPAN&gt;''&lt;BR /&gt;&lt;/SPAN&gt;sectioncode_param = &lt;SPAN&gt;''&lt;BR /&gt;&lt;/SPAN&gt;beatcode_param = &lt;SPAN&gt;''&lt;BR /&gt;&lt;/SPAN&gt;tid_param = &lt;SPAN&gt;''&lt;BR /&gt;&lt;/SPAN&gt;forest_code_param = &lt;SPAN&gt;''&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN&gt;try&lt;/SPAN&gt;:&lt;BR /&gt;    rangecode_param = arcpy.GetParameterAsText(&lt;SPAN&gt;0&lt;/SPAN&gt;)&lt;BR /&gt;    stdate_param = arcpy.GetParameterAsText(&lt;SPAN&gt;1&lt;/SPAN&gt;)&lt;BR /&gt;    eddate_param = arcpy.GetParameterAsText(&lt;SPAN&gt;2&lt;/SPAN&gt;)&lt;BR /&gt;    sectioncode_param = arcpy.GetParameterAsText(&lt;SPAN&gt;3&lt;/SPAN&gt;)&lt;BR /&gt;    beatcode_param = arcpy.GetParameterAsText(&lt;SPAN&gt;4&lt;/SPAN&gt;)&lt;BR /&gt;    tid_param = arcpy.GetParameterAsText(&lt;SPAN&gt;5&lt;/SPAN&gt;)&lt;BR /&gt;    forest_code_param = arcpy.GetParameterAsText(&lt;SPAN&gt;6&lt;/SPAN&gt;)&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;except &lt;/SPAN&gt;&lt;SPAN&gt;Exception &lt;/SPAN&gt;&lt;SPAN&gt;as &lt;/SPAN&gt;e:&lt;BR /&gt;    &lt;SPAN&gt;print&lt;/SPAN&gt;(e)&lt;BR /&gt;&lt;BR /&gt;feature_info = []&lt;BR /&gt;tripid = &lt;SPAN&gt;''&lt;BR /&gt;&lt;/SPAN&gt;features = []&lt;BR /&gt;feat = []&lt;BR /&gt;count = &lt;SPAN&gt;0&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN&gt;try&lt;/SPAN&gt;:&lt;BR /&gt;    query1 = &lt;SPAN&gt;"some sql query for mandatory inputs&lt;/SPAN&gt;&lt;SPAN&gt;"&lt;BR /&gt;    ###################################################&lt;BR /&gt;      ifelse condition lader for optional user inputs&lt;BR /&gt;    ###################################################&lt;BR /&gt;&lt;/SPAN&gt;    &lt;SPAN&gt;if &lt;/SPAN&gt;sectioncode_param != &lt;SPAN&gt;''&lt;/SPAN&gt;:&lt;BR /&gt;        query1 = query1 + &lt;SPAN&gt;"and sectionCode = '"&lt;/SPAN&gt;+sectioncode_param+&lt;SPAN&gt;"'"&lt;BR /&gt;&lt;/SPAN&gt;    &lt;SPAN&gt;elif &lt;/SPAN&gt;beatcode_param != &lt;SPAN&gt;''&lt;/SPAN&gt;:&lt;BR /&gt;        query1 = query1 + &lt;SPAN&gt;"and beatCode = '" &lt;/SPAN&gt;+ beatparam + &lt;SPAN&gt;"'"&lt;BR /&gt;&lt;/SPAN&gt;    &lt;SPAN&gt;elif &lt;/SPAN&gt;tid_param != &lt;SPAN&gt;''&lt;/SPAN&gt;:&lt;BR /&gt;        query1 = query1 + &lt;SPAN&gt;"and tripId = '" &lt;/SPAN&gt;+ tid_param + &lt;SPAN&gt;"'"&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN&gt;&lt;BR /&gt;&lt;/SPAN&gt;    TripData = sqlConn.execute(query1)&lt;BR /&gt;    result = TripData&lt;BR /&gt;&lt;BR /&gt;    tid = []&lt;BR /&gt;    &lt;SPAN&gt;for &lt;/SPAN&gt;p &lt;SPAN&gt;in &lt;/SPAN&gt;result:&lt;BR /&gt;        feature_info.append([&lt;SPAN&gt;str&lt;/SPAN&gt;(p[&lt;SPAN&gt;1&lt;/SPAN&gt;])&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;str&lt;/SPAN&gt;(p[&lt;SPAN&gt;0&lt;/SPAN&gt;])])&lt;BR /&gt;        tripid = p[&lt;SPAN&gt;2&lt;/SPAN&gt;]&lt;BR /&gt;        &lt;SPAN&gt;# tid.append(str(p[2]))&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN&gt;&lt;BR /&gt;&lt;/SPAN&gt;    features = []&lt;BR /&gt;    &lt;SPAN&gt;for &lt;/SPAN&gt;i &lt;SPAN&gt;in &lt;/SPAN&gt;feature_info:&lt;BR /&gt;        ix = &lt;SPAN&gt;float&lt;/SPAN&gt;(i[&lt;SPAN&gt;0&lt;/SPAN&gt;])&lt;BR /&gt;        iy = &lt;SPAN&gt;float&lt;/SPAN&gt;(i[&lt;SPAN&gt;1&lt;/SPAN&gt;])&lt;BR /&gt;        feat.append((ix&lt;SPAN&gt;, &lt;/SPAN&gt;iy))&lt;BR /&gt;&lt;BR /&gt;    &lt;SPAN&gt;&lt;BR /&gt;&lt;/SPAN&gt;    fc = &lt;SPAN&gt;"E:&lt;/SPAN&gt;&lt;SPAN&gt;\\&lt;/SPAN&gt;&lt;SPAN&gt;sadiq&lt;/SPAN&gt;&lt;SPAN&gt;\\&lt;/SPAN&gt;&lt;SPAN&gt;live proj&lt;/SPAN&gt;&lt;SPAN&gt;\\&lt;/SPAN&gt;&lt;SPAN&gt;working&lt;/SPAN&gt;&lt;SPAN&gt;\\&lt;/SPAN&gt;&lt;SPAN&gt;New Personal Geodatabase.mdb&lt;/SPAN&gt;&lt;SPAN&gt;\\&lt;/SPAN&gt;&lt;SPAN&gt;pat_point"&lt;BR /&gt;&lt;/SPAN&gt;    cursor = arcpy.da.InsertCursor(fc&lt;SPAN&gt;, &lt;/SPAN&gt;[&lt;SPAN&gt;"SHAPE@XY"&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;"tripid"&lt;/SPAN&gt;])&lt;BR /&gt;    &lt;SPAN&gt;for &lt;/SPAN&gt;row &lt;SPAN&gt;in &lt;/SPAN&gt;feat:&lt;BR /&gt;        cursor.insertRow([row&lt;SPAN&gt;, &lt;/SPAN&gt;tripid])&lt;BR /&gt;&lt;BR /&gt;    arcpy.env.workspace = &lt;SPAN&gt;"E:&lt;/SPAN&gt;&lt;SPAN&gt;\\&lt;/SPAN&gt;&lt;SPAN&gt;sadiq&lt;/SPAN&gt;&lt;SPAN&gt;\\&lt;/SPAN&gt;&lt;SPAN&gt;live proj&lt;/SPAN&gt;&lt;SPAN&gt;\\&lt;/SPAN&gt;&lt;SPAN&gt;working&lt;/SPAN&gt;&lt;SPAN&gt;\\&lt;/SPAN&gt;&lt;SPAN&gt;New Personal Geodatabase.mdb"&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN&gt;&lt;BR /&gt;&lt;/SPAN&gt;    Buff = &lt;SPAN&gt;"E:&lt;/SPAN&gt;&lt;SPAN&gt;\\&lt;/SPAN&gt;&lt;SPAN&gt;sadiq&lt;/SPAN&gt;&lt;SPAN&gt;\\&lt;/SPAN&gt;&lt;SPAN&gt;live proj&lt;/SPAN&gt;&lt;SPAN&gt;\\&lt;/SPAN&gt;&lt;SPAN&gt;working&lt;/SPAN&gt;&lt;SPAN&gt;\\&lt;/SPAN&gt;&lt;SPAN&gt;New Personal Geodatabase.mdb&lt;/SPAN&gt;&lt;SPAN&gt;\\&lt;/SPAN&gt;&lt;SPAN&gt;new_buff_v7"&lt;BR /&gt;&lt;/SPAN&gt;    arcpy.Buffer_analysis(&lt;SPAN&gt;"E:&lt;/SPAN&gt;&lt;SPAN&gt;\\&lt;/SPAN&gt;&lt;SPAN&gt;sadiq&lt;/SPAN&gt;&lt;SPAN&gt;\\&lt;/SPAN&gt;&lt;SPAN&gt;live proj&lt;/SPAN&gt;&lt;SPAN&gt;\\&lt;/SPAN&gt;&lt;SPAN&gt;working&lt;/SPAN&gt;&lt;SPAN&gt;\\&lt;/SPAN&gt;&lt;SPAN&gt;New Personal Geodatabase.mdb&lt;/SPAN&gt;&lt;SPAN&gt;\\&lt;/SPAN&gt;&lt;SPAN&gt;pat_point"&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;Buff&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;"50 Meters"&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;"FULL"&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;"ROUND"&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;"LIST"&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;"tripid"&lt;/SPAN&gt;)&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;    &lt;SPAN&gt;if &lt;/SPAN&gt;forest_code_param != &lt;SPAN&gt;''&lt;/SPAN&gt;:&lt;BR /&gt;        inputfc = &lt;SPAN&gt;"Database Connections&lt;/SPAN&gt;&lt;SPAN&gt;\\*******database server*******&lt;/SPAN&gt;&lt;SPAN&gt;\\********database table********&lt;/SPAN&gt;&lt;SPAN&gt;"&lt;BR /&gt;&lt;/SPAN&gt;        gp.Select_analysis(inputfc&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;"E:&lt;/SPAN&gt;&lt;SPAN&gt;\\&lt;/SPAN&gt;&lt;SPAN&gt;sadiq&lt;/SPAN&gt;&lt;SPAN&gt;\\&lt;/SPAN&gt;&lt;SPAN&gt;live proj&lt;/SPAN&gt;&lt;SPAN&gt;\\&lt;/SPAN&gt;&lt;SPAN&gt;working&lt;/SPAN&gt;&lt;SPAN&gt;\\&lt;/SPAN&gt;&lt;SPAN&gt;New Personal Geodatabase.mdb&lt;/SPAN&gt;&lt;SPAN&gt;\\&lt;/SPAN&gt;&lt;SPAN&gt;featureclass"&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;"ForestCode = '"&lt;/SPAN&gt;+forest_code_param+&lt;SPAN&gt;"'"&lt;/SPAN&gt;)&lt;BR /&gt;        inFeatures = [&lt;SPAN&gt;"E:&lt;/SPAN&gt;&lt;SPAN&gt;\\&lt;/SPAN&gt;&lt;SPAN&gt;sadiq&lt;/SPAN&gt;&lt;SPAN&gt;\\&lt;/SPAN&gt;&lt;SPAN&gt;live proj&lt;/SPAN&gt;&lt;SPAN&gt;\\&lt;/SPAN&gt;&lt;SPAN&gt;working&lt;/SPAN&gt;&lt;SPAN&gt;\\&lt;/SPAN&gt;&lt;SPAN&gt;New Personal Geodatabase.mdb&lt;/SPAN&gt;&lt;SPAN&gt;\\&lt;/SPAN&gt;&lt;SPAN&gt;new_buff_v7"&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;"E:&lt;/SPAN&gt;&lt;SPAN&gt;\\&lt;/SPAN&gt;&lt;SPAN&gt;sadiq&lt;/SPAN&gt;&lt;SPAN&gt;\\&lt;/SPAN&gt;&lt;SPAN&gt;live proj&lt;/SPAN&gt;&lt;SPAN&gt;\\&lt;/SPAN&gt;&lt;SPAN&gt;working&lt;/SPAN&gt;&lt;SPAN&gt;\\&lt;/SPAN&gt;&lt;SPAN&gt;New Personal Geodatabase.mdb&lt;/SPAN&gt;&lt;SPAN&gt;\\&lt;/SPAN&gt;&lt;SPAN&gt;featureclass"&lt;/SPAN&gt;]&lt;BR /&gt;    &lt;SPAN&gt;else&lt;/SPAN&gt;:&lt;BR /&gt;        inFeatures = [&lt;SPAN&gt;"E:&lt;/SPAN&gt;&lt;SPAN&gt;\\&lt;/SPAN&gt;&lt;SPAN&gt;sadiq&lt;/SPAN&gt;&lt;SPAN&gt;\\&lt;/SPAN&gt;&lt;SPAN&gt;live proj&lt;/SPAN&gt;&lt;SPAN&gt;\\&lt;/SPAN&gt;&lt;SPAN&gt;working&lt;/SPAN&gt;&lt;SPAN&gt;\\&lt;/SPAN&gt;&lt;SPAN&gt;New Personal Geodatabase.mdb&lt;/SPAN&gt;&lt;SPAN&gt;\\&lt;/SPAN&gt;&lt;SPAN&gt;new_buff_v7"&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;"Database Connections\\*******database server*******\\********database table********&lt;/SPAN&gt;&lt;SPAN&gt;"&lt;/SPAN&gt;]&lt;BR /&gt;&lt;BR /&gt;    outFeatures = &lt;SPAN&gt;"E:&lt;/SPAN&gt;&lt;SPAN&gt;\\&lt;/SPAN&gt;&lt;SPAN&gt;sadiq&lt;/SPAN&gt;&lt;SPAN&gt;\\&lt;/SPAN&gt;&lt;SPAN&gt;live proj&lt;/SPAN&gt;&lt;SPAN&gt;\\&lt;/SPAN&gt;&lt;SPAN&gt;working&lt;/SPAN&gt;&lt;SPAN&gt;\\&lt;/SPAN&gt;&lt;SPAN&gt;New Personal Geodatabase.mdb&lt;/SPAN&gt;&lt;SPAN&gt;\\&lt;/SPAN&gt;&lt;SPAN&gt;intersect_7"&lt;BR /&gt;&lt;/SPAN&gt;    arcpy.Intersect_analysis(inFeatures&lt;SPAN&gt;, &lt;/SPAN&gt;outFeatures&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;""&lt;/SPAN&gt;)&lt;BR /&gt;&lt;BR /&gt;    arcpy.DeleteRows_management(&lt;SPAN&gt;"E:&lt;/SPAN&gt;&lt;SPAN&gt;\\&lt;/SPAN&gt;&lt;SPAN&gt;sadiq&lt;/SPAN&gt;&lt;SPAN&gt;\\&lt;/SPAN&gt;&lt;SPAN&gt;live proj&lt;/SPAN&gt;&lt;SPAN&gt;\\&lt;/SPAN&gt;&lt;SPAN&gt;working&lt;/SPAN&gt;&lt;SPAN&gt;\\&lt;/SPAN&gt;&lt;SPAN&gt;New Personal Geodatabase.mdb&lt;/SPAN&gt;&lt;SPAN&gt;\\&lt;/SPAN&gt;&lt;SPAN&gt;pat_point"&lt;/SPAN&gt;)&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;except &lt;/SPAN&gt;&lt;SPAN&gt;Exception &lt;/SPAN&gt;&lt;SPAN&gt;as &lt;/SPAN&gt;e:&lt;BR /&gt;    &lt;SPAN&gt;print&lt;/SPAN&gt;(e)&lt;BR /&gt;&lt;BR /&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;below are some snap shots that were captured while running the script as a geoprocessing service&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Capture1.PNG" style="width: 750px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/6866i9015E09D6FEFCC4D/image-size/large?v=v2&amp;amp;px=999" role="button" title="Capture1.PNG" alt="Capture1.PNG" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Capture2.PNG" style="width: 815px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/6868iF8E480EBC212B9F6/image-size/large?v=v2&amp;amp;px=999" role="button" title="Capture2.PNG" alt="Capture2.PNG" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="when clicked on &amp;quot;Check Job Details Again&amp;quot; displays this without even a second timelapse." style="width: 655px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/6867i7729443AF8683580/image-size/large?v=v2&amp;amp;px=999" role="button" title="Capture3.PNG" alt="when clicked on &amp;quot;Check Job Details Again&amp;quot; displays this without even a second timelapse." /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;when clicked on "Check Job Details Again" displays this without even a second timelapse.&lt;/span&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Capture4.PNG" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/6869i2D1EDE405BC61AE1/image-size/large?v=v2&amp;amp;px=999" role="button" title="Capture4.PNG" alt="Capture4.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;kindly help resolving this&lt;BR /&gt;Thanks in advance&lt;/P&gt;</description>
      <pubDate>Thu, 25 Feb 2021 06:36:44 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-script-with-user-input-options-not-working/m-p/1030345#M60109</guid>
      <dc:creator>JayakumarPD</dc:creator>
      <dc:date>2021-02-25T06:36:44Z</dc:date>
    </item>
    <item>
      <title>Re: Python script with user input options not working in geoprocessing service</title>
      <link>https://community.esri.com/t5/python-questions/python-script-with-user-input-options-not-working/m-p/1030379#M60111</link>
      <description>&lt;P&gt;hi DavidPike,&lt;/P&gt;&lt;P&gt;please find the attached code and kindly suggest.&lt;/P&gt;</description>
      <pubDate>Thu, 25 Feb 2021 09:11:30 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-script-with-user-input-options-not-working/m-p/1030379#M60111</guid>
      <dc:creator>JayakumarPD</dc:creator>
      <dc:date>2021-02-25T09:11:30Z</dc:date>
    </item>
    <item>
      <title>Re: Python script with user input options not working in geoprocessing service</title>
      <link>https://community.esri.com/t5/python-questions/python-script-with-user-input-options-not-working/m-p/1030380#M60112</link>
      <description>&lt;P&gt;hi Jcarlson,&lt;/P&gt;&lt;P&gt;please find the attached code and kindly suggest.&lt;/P&gt;</description>
      <pubDate>Thu, 25 Feb 2021 09:12:21 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-script-with-user-input-options-not-working/m-p/1030380#M60112</guid>
      <dc:creator>JayakumarPD</dc:creator>
      <dc:date>2021-02-25T09:12:21Z</dc:date>
    </item>
    <item>
      <title>Re: Python script with user input options not working in geoprocessing service</title>
      <link>https://community.esri.com/t5/python-questions/python-script-with-user-input-options-not-working/m-p/1030395#M60113</link>
      <description>&lt;P&gt;I'll have a look through, but in the meantime you may get some better logging info by republishing (or maybe you can change in server manager?) and setting the logging to verbose or something (I cant quite remember where the option is, but there is one) this might capture a better log next time it fails.&lt;/P&gt;</description>
      <pubDate>Thu, 25 Feb 2021 12:41:59 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-script-with-user-input-options-not-working/m-p/1030395#M60113</guid>
      <dc:creator>DavidPike</dc:creator>
      <dc:date>2021-02-25T12:41:59Z</dc:date>
    </item>
    <item>
      <title>Re: Python script with user input options not working in geoprocessing service</title>
      <link>https://community.esri.com/t5/python-questions/python-script-with-user-input-options-not-working/m-p/1030888#M60136</link>
      <description>&lt;P&gt;So, I see where you are getting the dates, but I do not see you use them anywhere in your code.&amp;nbsp; Are you using them in your sql query? Have you tried with a default value from the script and not from the geoprocessing service input?&lt;/P&gt;&lt;LI-CODE lang="python"&gt;# sets a default if the parameter comes back empty or None
stdate_param = arcpy.GetParameterAsText(1)
if stdate_param == '#' or not stdate_param:
    stdate_param = '2020-05-01'&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;and here, you are concatenating the strings together&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;query1 = "some sql query for mandatory inputs"
    ###################################################
      ifelse condition lader for optional user inputs
    ###################################################
    if sectioncode_param != '':
        query1 = query1 + "and sectionCode = '"+sectioncode_param+"'"&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;will make your query1 end up like:&lt;/P&gt;&lt;P&gt;"some sql query for mandatory inputs and sectionCode = '"+sectioncode_param+"'"&lt;/P&gt;&lt;P&gt;Unless you took it out to post on the forum since you mentioned that it works as a script...&lt;/P&gt;&lt;P&gt;Last thing I can think of as is, can the server you have this process on use the myDB connection (username/password, SSO, etc)- i.e., its not tied to your login so it only works when you are logged in?&lt;/P&gt;</description>
      <pubDate>Fri, 26 Feb 2021 04:47:01 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-script-with-user-input-options-not-working/m-p/1030888#M60136</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2021-02-26T04:47:01Z</dc:date>
    </item>
  </channel>
</rss>

