<?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: Dynamically populate input fields in python toolbox in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/dynamically-populate-input-fields-in-python/m-p/1409335#M70300</link>
    <description>&lt;P&gt;I see GPValueTable is listed as a datatype for parameters so this might be the answer! Will give a try, thanks for the tip&lt;/P&gt;</description>
    <pubDate>Sat, 13 Apr 2024 16:08:43 GMT</pubDate>
    <dc:creator>sbrowneotogo</dc:creator>
    <dc:date>2024-04-13T16:08:43Z</dc:date>
    <item>
      <title>Dynamically populate input fields in python toolbox</title>
      <link>https://community.esri.com/t5/python-questions/dynamically-populate-input-fields-in-python/m-p/1409332#M70298</link>
      <description>&lt;P&gt;Hello ESRI community,&lt;/P&gt;&lt;P&gt;I'm working on a python toolbox that will have many variables that the user can change. I'm trying to find a way to do this without having dozens of parameters in my arcpy toolbox, which will make maintenance of this tool an absolute nightmare.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;To give a quick summary, I have several categories, and within each category there maybe be 6 to 10 variables that the user can change. The way I structured the tool is to save a JSON for each category (this also allows me to save state between runs).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Within getParameters, the user chooses a category from a dropdown list:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;var_name = arcpy.Parameter(
displayName="Variable Name",
name="var_name",
datatype="GPString",
parameterType="Required",
direction="Input")
var_name.filter.list = ["Category1", "Category2", "Category3", "Category4"]&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;and for each of these categories, there's another parameter which contains the JSON:&lt;/P&gt;&lt;LI-CODE lang="python"&gt;category1 = arcpy.Parameter(
displayName="Category 1",
name="category1 ",
datatype="GPString",
parameterType="Required",
direction="Input")
category1.enabled = 0&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is always disabled, and the user doesn't see it. It contains a string of a JSON that might looks like this:&lt;/P&gt;&lt;P&gt;{'var1': 10, 'var2' :20, 'var3': 30, 'var4': 40, 'var5': 50, 'var6': 60, 'var7': 70, 'var8': 80}&lt;/P&gt;&lt;P&gt;Then I'll have a parameter for each of these vars, which is enabled and populated from the parsed JSON when the relevant category is chosen and disabled otherwise. As you can tell by doing some simple math, this will result in 50+ parameters (yikes). My plan was to have 8 parameters that simply get recycled between categories, but that was foiled when I discovered you can't change the displayName property in updateParameters.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is there a way to structure this tool so users can modify the many variables without having so many parameters? I'm not sure if the question was clear enough, I'm happy to clarify if helpful.&lt;/P&gt;</description>
      <pubDate>Sat, 13 Apr 2024 15:34:12 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/dynamically-populate-input-fields-in-python/m-p/1409332#M70298</guid>
      <dc:creator>sbrowneotogo</dc:creator>
      <dc:date>2024-04-13T15:34:12Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamically populate input fields in python toolbox</title>
      <link>https://community.esri.com/t5/python-questions/dynamically-populate-input-fields-in-python/m-p/1409334#M70299</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Take a look at using a&amp;nbsp;&lt;A href="https://pro.arcgis.com/en/pro-app/latest/arcpy/classes/valuetable.htm" target="_self"&gt;Value Table&lt;/A&gt; parameter.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 13 Apr 2024 15:44:52 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/dynamically-populate-input-fields-in-python/m-p/1409334#M70299</guid>
      <dc:creator>Dale_Honeycutt</dc:creator>
      <dc:date>2024-04-13T15:44:52Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamically populate input fields in python toolbox</title>
      <link>https://community.esri.com/t5/python-questions/dynamically-populate-input-fields-in-python/m-p/1409335#M70300</link>
      <description>&lt;P&gt;I see GPValueTable is listed as a datatype for parameters so this might be the answer! Will give a try, thanks for the tip&lt;/P&gt;</description>
      <pubDate>Sat, 13 Apr 2024 16:08:43 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/dynamically-populate-input-fields-in-python/m-p/1409335#M70300</guid>
      <dc:creator>sbrowneotogo</dc:creator>
      <dc:date>2024-04-13T16:08:43Z</dc:date>
    </item>
  </channel>
</rss>

