<?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: Can you input a parameter value after starting a script tool? in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/can-you-input-a-parameter-value-after-starting-a/m-p/1112291#M62837</link>
    <description>&lt;P&gt;If you need the index for other things in your code, you can create a 'read-only' kind of parameter parameters[4](?) and set it when you get the index.&lt;/P&gt;</description>
    <pubDate>Fri, 29 Oct 2021 00:56:01 GMT</pubDate>
    <dc:creator>Anonymous User</dc:creator>
    <dc:date>2021-10-29T00:56:01Z</dc:date>
    <item>
      <title>Can you input a parameter value after starting a script tool?</title>
      <link>https://community.esri.com/t5/python-questions/can-you-input-a-parameter-value-after-starting-a/m-p/1111415#M62799</link>
      <description>&lt;P&gt;I have a python script that will edit all map service capabilities for all services on a federated GIS Server. The script will print out a list of GIS Servers in a federated Enterprise environment &amp;gt; prompt the user to input an integer associated with the index of which GIS Server they want to operate on &amp;gt; all map services are updated on that server.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to convert this to a script tool in ArcGIS Pro. &lt;STRONG&gt;My script requires the user to input a value after it prints the list of GIS Servers, so it knows which server to run the remaining script on. Is this possible using a script tool? If so, how can I do this?&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 26 Oct 2021 19:25:12 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/can-you-input-a-parameter-value-after-starting-a/m-p/1111415#M62799</guid>
      <dc:creator>tigerwoulds</dc:creator>
      <dc:date>2021-10-26T19:25:12Z</dc:date>
    </item>
    <item>
      <title>Re: Can you input a parameter value after starting a script tool?</title>
      <link>https://community.esri.com/t5/python-questions/can-you-input-a-parameter-value-after-starting-a/m-p/1111445#M62800</link>
      <description>&lt;P&gt;You can probably have the tool provide a list of available servers using the ToolValidator class as a filter that the person can then select. You can probably handle the index'ing (if needed) in the code behind by setting the selected server's index from the list into another parameter and retrieve it in your script... or just use the server name?&lt;/P&gt;&lt;LI-CODE lang="python"&gt;def updateParameters(self):
#     """Modify the values and properties of parameters before internal
#     validation is performed.  This method is called whenever a parameter
#     has been changed."""

     if self.params[0].value: # conditional to trigger setting the filter
         fcFilter = self.params[1].filter # the parameter that the user will pick from
         # your code for getting the list of servers
         serverList = list(set([line.strip().split('.')[1] for line in serverstuff]))
         serverList.sort() # if you want to
         fcFilter.list = serverList

     return&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 26 Oct 2021 21:05:07 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/can-you-input-a-parameter-value-after-starting-a/m-p/1111445#M62800</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2021-10-26T21:05:07Z</dc:date>
    </item>
    <item>
      <title>Re: Can you input a parameter value after starting a script tool?</title>
      <link>https://community.esri.com/t5/python-questions/can-you-input-a-parameter-value-after-starting-a/m-p/1111648#M62817</link>
      <description>&lt;P&gt;Thanks I will look into this. Sounds like I will need to use a Python Toolbox over a Script Tool.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 27 Oct 2021 14:58:03 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/can-you-input-a-parameter-value-after-starting-a/m-p/1111648#M62817</guid>
      <dc:creator>tigerwoulds</dc:creator>
      <dc:date>2021-10-27T14:58:03Z</dc:date>
    </item>
    <item>
      <title>Re: Can you input a parameter value after starting a script tool?</title>
      <link>https://community.esri.com/t5/python-questions/can-you-input-a-parameter-value-after-starting-a/m-p/1111856#M62825</link>
      <description>&lt;P&gt;@Anonymous User&amp;nbsp;I'm attempting a python toolbox for the first time and hitting a wall. I would like the enter the Portal URL, username, password and have the GIS Server parameter auto populate with a drop down list of all my federated servers. If I comment out the &lt;EM&gt;updateParameters&lt;/EM&gt; method, then I can enter the other parameters without the error. Any ideas what I need to do here?&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="TigerWoulds_0-1635365993273.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/26347i958E8EA3EF712716/image-size/medium?v=v2&amp;amp;px=400" role="button" title="TigerWoulds_0-1635365993273.png" alt="TigerWoulds_0-1635365993273.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;# -*- coding: utf-8 -*-
import arcpy
from arcgis.gis import GIS

class Toolbox(object):
    def __init__(self):
        """Define the toolbox (the name of the toolbox is the name of the
        .pyt file)."""
        self.label = "Toolbox"
        self.alias = "toolbox"

        # List of tool classes associated with this toolbox
        self.tools = [SwitchInstanceTypeToDedicated]

class SwitchInstanceTypeToDedicated(object):
    def __init__(self):
        """Define the tool (tool name is the name of the class)."""
        self.label = "Edit REST Service"
        self.description = ""
        self.canRunInBackground = False

    def getParameterInfo(self):
        """Define parameter definitions"""
        param0 = arcpy.Parameter(
            displayName="Portal URL eg. https://arcgis.com/portal",
            name="PortalURL",
            datatype="string",
            parameterType="Required",
            direction="Input")

        param1 = arcpy.Parameter(
            displayName="Username (must be Admin level)",
            name="username",
            datatype="string",
            parameterType="Required",
            direction="Input")

        param2 = arcpy.Parameter(
            displayName="Password",
            name="password",
            datatype="string",
            parameterType="Required",
            direction="Input")

        param3 = arcpy.Parameter(
            displayName="GIS Server",
            name="gisSrv",
            datatype="string",
            parameterType="Required",
            direction="Input")

        params = [param0, param1, param2, param3]
        return params

    def isLicensed(self):
        """Set whether tool is licensed to execute."""
        return True

    def updateParameters(self, parameters):
        """Modify the values and properties of parameters before internal
        validation is performed.  This method is called whenever a parameter
        has been changed."""
        if params[0].value:  # conditional to trigger setting the filter
            fcFilter = params[3].filter  # the parameter that the user will pick from
            # your code for getting the list of servers
            # Connect to GIS Portal
            gis = GIS(param0, param1, param2, verify_cert=False)
            # List GIS Servers
            serverList = gis.admin.servers.list()
            # serverList.sort()  # if you want to
            fcFilter.list = serverList
        return

    def updateMessages(self, parameters):
        """Modify the messages created by internal validation for each tool
        parameter.  This method is called after internal validation."""

        return

    def execute(self, parameters, messages):
        """The source code of the tool."""
        arcpy.AddMessage('Hello World')
        return&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 27 Oct 2021 20:22:49 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/can-you-input-a-parameter-value-after-starting-a/m-p/1111856#M62825</guid>
      <dc:creator>tigerwoulds</dc:creator>
      <dc:date>2021-10-27T20:22:49Z</dc:date>
    </item>
    <item>
      <title>Re: Can you input a parameter value after starting a script tool?</title>
      <link>https://community.esri.com/t5/python-questions/can-you-input-a-parameter-value-after-starting-a/m-p/1111908#M62827</link>
      <description>&lt;P&gt;Couple of things here that I would try- I think you need to set the param0-param3 to be instance variables by adding the 'self.' in front of them.&amp;nbsp; Class variables (without the self.) can only be assigned when a class has been defined. Instance variables (self.) , on the other hand, can be assigned or changed at any time.&amp;nbsp; Then you can access them/change them in your other class methods by also referring to them with the 'self.' prefix. You also need to get the values of the parameters, instead of passing the complete param object so adding .valueAsText() on the end of them should get you the string value.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 27 Oct 2021 21:57:28 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/can-you-input-a-parameter-value-after-starting-a/m-p/1111908#M62827</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2021-10-27T21:57:28Z</dc:date>
    </item>
    <item>
      <title>Re: Can you input a parameter value after starting a script tool?</title>
      <link>https://community.esri.com/t5/python-questions/can-you-input-a-parameter-value-after-starting-a/m-p/1112013#M62828</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/111548"&gt;@tigerwoulds&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;&lt;P&gt;Sounds like I will need to use a Python Toolbox over a Script Tool.&amp;nbsp;&lt;/P&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;BR /&gt;No you can still use a script tool. They support validation code.&lt;/P&gt;&lt;P&gt;&lt;A href="https://pro.arcgis.com/en/pro-app/latest/arcpy/geoprocessing_and_python/understanding-validation-in-script-tools.htm" target="_blank" rel="noopener"&gt;https://pro.arcgis.com/en/pro-app/latest/arcpy/geoprocessing_and_python/understanding-validation-in-script-tools.htm&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 28 Oct 2021 08:37:10 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/can-you-input-a-parameter-value-after-starting-a/m-p/1112013#M62828</guid>
      <dc:creator>Luke_Pinner</dc:creator>
      <dc:date>2021-10-28T08:37:10Z</dc:date>
    </item>
    <item>
      <title>Re: Can you input a parameter value after starting a script tool?</title>
      <link>https://community.esri.com/t5/python-questions/can-you-input-a-parameter-value-after-starting-a/m-p/1112054#M62829</link>
      <description>&lt;P&gt;I see. Good to know, thanks!&lt;/P&gt;</description>
      <pubDate>Thu, 28 Oct 2021 12:59:24 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/can-you-input-a-parameter-value-after-starting-a/m-p/1112054#M62829</guid>
      <dc:creator>tigerwoulds</dc:creator>
      <dc:date>2021-10-28T12:59:24Z</dc:date>
    </item>
    <item>
      <title>Re: Can you input a parameter value after starting a script tool?</title>
      <link>https://community.esri.com/t5/python-questions/can-you-input-a-parameter-value-after-starting-a/m-p/1112199#M62831</link>
      <description>&lt;P&gt;Thanks! After some tinkering, I've got it working. I can enter my portal url, user, password and I get a list of GIS Servers to choose for the 3rd parameter.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;    def updateParameters(self, parameters):
        """Modify the values and properties of parameters before internal
        validation is performed.  This method is called whenever a parameter
        has been changed."""
        # Create a dropdown list for the GIS Server Parameter of all federated GIS Servers
        portal = parameters[0].valueAsText
        user = parameters[1].valueAsText
        password = parameters[2].valueAsText
        if parameters[2].value:  # If the password field is filled in
            gis = GIS(portal, user, password, verify_cert=False)
            serverList = gis.admin.servers.list()
            newList = []
            for item in serverList:
                myString = str(item)
                newList.append(myString)
            parameters[3].filter.list = newList&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;One issue is I am using the ArcGIS Python API in line 11 to get a List of GIS Server. If I pass that list directly into my Filter List&amp;nbsp; my toolbox throws this error.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;ValueError: FilterObject: illegal list value&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Turns out I need to convert each item in my serverList to a string and add it to a new list. Then, using the new list, my toolbox dropdown works correctly.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Say the user selects the 2 item in the dropdown (index 1), how I store that index number as a variable in my &lt;U&gt;updateParameters &lt;/U&gt;function and use that in my &lt;U&gt;execute&lt;/U&gt; function later?&lt;/P&gt;</description>
      <pubDate>Thu, 28 Oct 2021 17:30:24 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/can-you-input-a-parameter-value-after-starting-a/m-p/1112199#M62831</guid>
      <dc:creator>tigerwoulds</dc:creator>
      <dc:date>2021-10-28T17:30:24Z</dc:date>
    </item>
    <item>
      <title>Re: Can you input a parameter value after starting a script tool?</title>
      <link>https://community.esri.com/t5/python-questions/can-you-input-a-parameter-value-after-starting-a/m-p/1112214#M62832</link>
      <description>&lt;P&gt;This is what I've tried so far, but I need to be able to use the variable 'b' in my execute function. Any ideas?&lt;/P&gt;&lt;PRE&gt;&lt;SPAN&gt;def &lt;/SPAN&gt;&lt;SPAN&gt;updateParameters&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;self&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;parameters&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;SPAN&gt;:&lt;BR /&gt;&lt;/SPAN&gt;    &lt;SPAN&gt;"""Modify the values and properties of parameters before internal&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN&gt;    validation is performed.  This method is called whenever a parameter&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN&gt;    has been changed."""&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN&gt;    # Create a dropdown list for the GIS Server Parameter of all federated GIS Servers&lt;BR /&gt;&lt;/SPAN&gt;    portal &lt;SPAN&gt;= &lt;/SPAN&gt;&lt;SPAN&gt;parameters&lt;/SPAN&gt;&lt;SPAN&gt;[&lt;/SPAN&gt;&lt;SPAN&gt;0&lt;/SPAN&gt;&lt;SPAN&gt;].&lt;/SPAN&gt;valueAsText&lt;BR /&gt;    user &lt;SPAN&gt;= &lt;/SPAN&gt;&lt;SPAN&gt;parameters&lt;/SPAN&gt;&lt;SPAN&gt;[&lt;/SPAN&gt;&lt;SPAN&gt;1&lt;/SPAN&gt;&lt;SPAN&gt;].&lt;/SPAN&gt;valueAsText&lt;BR /&gt;    password &lt;SPAN&gt;= &lt;/SPAN&gt;&lt;SPAN&gt;parameters&lt;/SPAN&gt;&lt;SPAN&gt;[&lt;/SPAN&gt;&lt;SPAN&gt;2&lt;/SPAN&gt;&lt;SPAN&gt;].&lt;/SPAN&gt;valueAsText&lt;BR /&gt;    &lt;SPAN&gt;if &lt;/SPAN&gt;&lt;SPAN&gt;parameters&lt;/SPAN&gt;&lt;SPAN&gt;[&lt;/SPAN&gt;&lt;SPAN&gt;2&lt;/SPAN&gt;&lt;SPAN&gt;].&lt;/SPAN&gt;value&lt;SPAN&gt;:  &lt;/SPAN&gt;&lt;SPAN&gt;# If the password field is filled in&lt;BR /&gt;&lt;/SPAN&gt;        gis &lt;SPAN&gt;= &lt;/SPAN&gt;&lt;SPAN&gt;GIS&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;portal&lt;SPAN&gt;, &lt;/SPAN&gt;user&lt;SPAN&gt;, &lt;/SPAN&gt;password&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;verify_cert&lt;/SPAN&gt;&lt;SPAN&gt;=&lt;/SPAN&gt;&lt;SPAN&gt;False&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;BR /&gt;&lt;/SPAN&gt;        serverList &lt;SPAN&gt;= &lt;/SPAN&gt;gis&lt;SPAN&gt;.&lt;/SPAN&gt;admin&lt;SPAN&gt;.&lt;/SPAN&gt;servers&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;list&lt;/SPAN&gt;&lt;SPAN&gt;()&lt;BR /&gt;&lt;/SPAN&gt;        newList &lt;SPAN&gt;= &lt;/SPAN&gt;&lt;SPAN&gt;[]&lt;BR /&gt;&lt;/SPAN&gt;        &lt;SPAN&gt;for &lt;/SPAN&gt;item &lt;SPAN&gt;in &lt;/SPAN&gt;serverList&lt;SPAN&gt;:&lt;BR /&gt;&lt;/SPAN&gt;            myString &lt;SPAN&gt;= &lt;/SPAN&gt;&lt;SPAN&gt;str&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;item&lt;SPAN&gt;)&lt;BR /&gt;&lt;/SPAN&gt;            newList&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;append&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;myString&lt;SPAN&gt;)&lt;BR /&gt;&lt;/SPAN&gt;        &lt;SPAN&gt;parameters&lt;/SPAN&gt;&lt;SPAN&gt;[&lt;/SPAN&gt;&lt;SPAN&gt;3&lt;/SPAN&gt;&lt;SPAN&gt;].&lt;/SPAN&gt;filter&lt;SPAN&gt;.&lt;/SPAN&gt;list &lt;SPAN&gt;= &lt;/SPAN&gt;newList&lt;BR /&gt;        &lt;SPAN&gt;if &lt;/SPAN&gt;&lt;SPAN&gt;parameters&lt;/SPAN&gt;&lt;SPAN&gt;[&lt;/SPAN&gt;&lt;SPAN&gt;3&lt;/SPAN&gt;&lt;SPAN&gt;] &lt;/SPAN&gt;&lt;SPAN&gt;in &lt;/SPAN&gt;newList&lt;SPAN&gt;:&lt;BR /&gt;&lt;/SPAN&gt;            b &lt;SPAN&gt;= &lt;/SPAN&gt;newList&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;index&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;parameters&lt;/SPAN&gt;&lt;SPAN&gt;[&lt;/SPAN&gt;&lt;SPAN&gt;3&lt;/SPAN&gt;&lt;SPAN&gt;])&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN&gt;&lt;BR /&gt;&lt;/SPAN&gt;    &lt;SPAN&gt;return&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 28 Oct 2021 18:07:29 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/can-you-input-a-parameter-value-after-starting-a/m-p/1112214#M62832</guid>
      <dc:creator>tigerwoulds</dc:creator>
      <dc:date>2021-10-28T18:07:29Z</dc:date>
    </item>
    <item>
      <title>Re: Can you input a parameter value after starting a script tool?</title>
      <link>https://community.esri.com/t5/python-questions/can-you-input-a-parameter-value-after-starting-a/m-p/1112288#M62835</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/111548"&gt;@tigerwoulds&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;&lt;P&gt;This is what I've tried so far, but I need to be able to use the variable 'b' in my execute function.&lt;/P&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;BR /&gt;You don't.&amp;nbsp; You just use&amp;nbsp;&lt;FONT face="courier new,courier" size="2"&gt;parameters[3].valueAsText&lt;/FONT&gt; in your execute function.&lt;/P&gt;</description>
      <pubDate>Fri, 29 Oct 2021 00:41:11 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/can-you-input-a-parameter-value-after-starting-a/m-p/1112288#M62835</guid>
      <dc:creator>Luke_Pinner</dc:creator>
      <dc:date>2021-10-29T00:41:11Z</dc:date>
    </item>
    <item>
      <title>Re: Can you input a parameter value after starting a script tool?</title>
      <link>https://community.esri.com/t5/python-questions/can-you-input-a-parameter-value-after-starting-a/m-p/1112291#M62837</link>
      <description>&lt;P&gt;If you need the index for other things in your code, you can create a 'read-only' kind of parameter parameters[4](?) and set it when you get the index.&lt;/P&gt;</description>
      <pubDate>Fri, 29 Oct 2021 00:56:01 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/can-you-input-a-parameter-value-after-starting-a/m-p/1112291#M62837</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2021-10-29T00:56:01Z</dc:date>
    </item>
    <item>
      <title>Re: Can you input a parameter value after starting a script tool?</title>
      <link>https://community.esri.com/t5/python-questions/can-you-input-a-parameter-value-after-starting-a/m-p/1112305#M62838</link>
      <description>&lt;P&gt;I need the the index of the GIS Server the user selects as a variable to use later on in my execute. Using&amp;nbsp;&lt;FONT face="courier new,courier" size="2"&gt;parameters[3].valueAsText&lt;/FONT&gt;&lt;SPAN&gt;&amp;nbsp; does not provide this.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;I did figure this out though, so thank you for you help!&lt;/P&gt;&lt;PRE&gt;&lt;SPAN&gt;def &lt;/SPAN&gt;execute&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;self&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;parameters&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;messages&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;SPAN&gt;:&lt;BR /&gt;&lt;/SPAN&gt;    &lt;SPAN&gt;"""The source code of the tool."""&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN&gt;    # Input Parameters&lt;BR /&gt;&lt;/SPAN&gt;    startTime &lt;SPAN&gt;= &lt;/SPAN&gt;time&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;time&lt;/SPAN&gt;&lt;SPAN&gt;()&lt;BR /&gt;&lt;/SPAN&gt;    portal &lt;SPAN&gt;= &lt;/SPAN&gt;&lt;SPAN&gt;parameters&lt;/SPAN&gt;&lt;SPAN&gt;[&lt;/SPAN&gt;&lt;SPAN&gt;0&lt;/SPAN&gt;&lt;SPAN&gt;].&lt;/SPAN&gt;valueAsText&lt;BR /&gt;    user &lt;SPAN&gt;= &lt;/SPAN&gt;&lt;SPAN&gt;parameters&lt;/SPAN&gt;&lt;SPAN&gt;[&lt;/SPAN&gt;&lt;SPAN&gt;1&lt;/SPAN&gt;&lt;SPAN&gt;].&lt;/SPAN&gt;valueAsText&lt;BR /&gt;    password &lt;SPAN&gt;= &lt;/SPAN&gt;&lt;SPAN&gt;parameters&lt;/SPAN&gt;&lt;SPAN&gt;[&lt;/SPAN&gt;&lt;SPAN&gt;2&lt;/SPAN&gt;&lt;SPAN&gt;].&lt;/SPAN&gt;valueAsText&lt;BR /&gt;    &lt;SPAN&gt;# Based on which server the user selects for the GIS Server drop down, get the Index Number for that to pass into the rest of the script&lt;BR /&gt;&lt;/SPAN&gt;    &lt;SPAN&gt;if &lt;/SPAN&gt;&lt;SPAN&gt;parameters&lt;/SPAN&gt;&lt;SPAN&gt;[&lt;/SPAN&gt;&lt;SPAN&gt;2&lt;/SPAN&gt;&lt;SPAN&gt;].&lt;/SPAN&gt;value&lt;SPAN&gt;:  &lt;/SPAN&gt;&lt;SPAN&gt;# If the password field is filled in&lt;BR /&gt;&lt;/SPAN&gt;        gis &lt;SPAN&gt;= &lt;/SPAN&gt;&lt;SPAN&gt;GIS&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;portal&lt;SPAN&gt;, &lt;/SPAN&gt;user&lt;SPAN&gt;, &lt;/SPAN&gt;password&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;verify_cert&lt;/SPAN&gt;&lt;SPAN&gt;=&lt;/SPAN&gt;&lt;SPAN&gt;False&lt;/SPAN&gt;&lt;SPAN&gt;) &lt;/SPAN&gt;&lt;SPAN&gt;# Connect to the GIS Portal&lt;BR /&gt;&lt;/SPAN&gt;        serverList &lt;SPAN&gt;= &lt;/SPAN&gt;gis&lt;SPAN&gt;.&lt;/SPAN&gt;admin&lt;SPAN&gt;.&lt;/SPAN&gt;servers&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;list&lt;/SPAN&gt;&lt;SPAN&gt;() &lt;/SPAN&gt;&lt;SPAN&gt;# Build a list of GIS Servers&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN&gt;        # Convert each item in the serverList to a string and add it to a new list&lt;BR /&gt;&lt;/SPAN&gt;        newList &lt;SPAN&gt;= &lt;/SPAN&gt;&lt;SPAN&gt;[]&lt;BR /&gt;&lt;/SPAN&gt;        &lt;SPAN&gt;for &lt;/SPAN&gt;item &lt;SPAN&gt;in &lt;/SPAN&gt;serverList&lt;SPAN&gt;:&lt;BR /&gt;&lt;/SPAN&gt;            myString &lt;SPAN&gt;= &lt;/SPAN&gt;&lt;SPAN&gt;str&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;item&lt;SPAN&gt;)&lt;BR /&gt;&lt;/SPAN&gt;            newList&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;append&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;myString&lt;SPAN&gt;)&lt;BR /&gt;&lt;/SPAN&gt;    x &lt;SPAN&gt;= &lt;/SPAN&gt;newList&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;index&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;parameters&lt;/SPAN&gt;&lt;SPAN&gt;[&lt;/SPAN&gt;&lt;SPAN&gt;3&lt;/SPAN&gt;&lt;SPAN&gt;].&lt;/SPAN&gt;valueAsText&lt;SPAN&gt;) &lt;/SPAN&gt;&lt;SPAN&gt;# Get index value from the server list based on which server the user selects&lt;BR /&gt;    ...&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 29 Oct 2021 02:12:13 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/can-you-input-a-parameter-value-after-starting-a/m-p/1112305#M62838</guid>
      <dc:creator>tigerwoulds</dc:creator>
      <dc:date>2021-10-29T02:12:13Z</dc:date>
    </item>
  </channel>
</rss>

