<?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 GPValueTable values in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/gpvaluetable-values/m-p/272061#M21017</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I am trying to create a python toolbox with a tool that presents the user with a Value Table with 3 columns. I am hoping to insert data into these columns as the user interacts with the tool through "updateParameters", but cannot seem to figure out how to format the values. Can anyone just give me a single line of code that would insert one row of values into the three columns for the value table below?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The only info I could find was &lt;/SPAN&gt;&lt;A href="http://resources.arcgis.com/en/help/main/10.1/index.html#/Defining_parameters_in_a_Python_toolbox/001500000028000000/ESRI_SECTION1_E2BAA5D4440D41D6AAB948922186905A/" rel="nofollow noopener noreferrer" target="_blank"&gt;here&lt;/A&gt;&lt;SPAN&gt; where it just says &lt;/SPAN&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;"To set default values for a value table parameter, use the values property, and provide the parameter values in a list of list of values."&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;But every time I try to use a list it errors.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Here is my code that I am using:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; param4 = arcpy.Parameter(
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; displayName='Features',
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; name='in_features',
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; datatype='GPValueTable',
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; parameterType='Required',
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; direction='Input')

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; param4.columns = [['String', 'Features'], ['String', 'Type'], ['String', 'Distance']]&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 11 Dec 2021 13:17:18 GMT</pubDate>
    <dc:creator>JeffreyOwen1</dc:creator>
    <dc:date>2021-12-11T13:17:18Z</dc:date>
    <item>
      <title>GPValueTable values</title>
      <link>https://community.esri.com/t5/python-questions/gpvaluetable-values/m-p/272061#M21017</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I am trying to create a python toolbox with a tool that presents the user with a Value Table with 3 columns. I am hoping to insert data into these columns as the user interacts with the tool through "updateParameters", but cannot seem to figure out how to format the values. Can anyone just give me a single line of code that would insert one row of values into the three columns for the value table below?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The only info I could find was &lt;/SPAN&gt;&lt;A href="http://resources.arcgis.com/en/help/main/10.1/index.html#/Defining_parameters_in_a_Python_toolbox/001500000028000000/ESRI_SECTION1_E2BAA5D4440D41D6AAB948922186905A/" rel="nofollow noopener noreferrer" target="_blank"&gt;here&lt;/A&gt;&lt;SPAN&gt; where it just says &lt;/SPAN&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;"To set default values for a value table parameter, use the values property, and provide the parameter values in a list of list of values."&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;But every time I try to use a list it errors.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Here is my code that I am using:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; param4 = arcpy.Parameter(
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; displayName='Features',
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; name='in_features',
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; datatype='GPValueTable',
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; parameterType='Required',
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; direction='Input')

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; param4.columns = [['String', 'Features'], ['String', 'Type'], ['String', 'Distance']]&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 13:17:18 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/gpvaluetable-values/m-p/272061#M21017</guid>
      <dc:creator>JeffreyOwen1</dc:creator>
      <dc:date>2021-12-11T13:17:18Z</dc:date>
    </item>
    <item>
      <title>Re: GPValueTable values</title>
      <link>https://community.esri.com/t5/python-questions/gpvaluetable-values/m-p/272062#M21018</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Would it work if you do this right after your code?&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_macro_code jive_text_macro"&gt;param4.values = [['c:/temp/land use.shp','POLYGON','123']]&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Or like this if you want multiple default rows filled in:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_macro_code jive_text_macro"&gt;param4.values = [['c:/temp/land_use.shp','POLYGON','123'],['c:/temp/roads.shp','POLYLINE','456']]&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Let us know how you get on, I always wondered how to do this.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Filip.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 25 Feb 2014 19:53:40 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/gpvaluetable-values/m-p/272062#M21018</guid>
      <dc:creator>FilipKrál</dc:creator>
      <dc:date>2014-02-25T19:53:40Z</dc:date>
    </item>
    <item>
      <title>Re: GPValueTable values</title>
      <link>https://community.esri.com/t5/python-questions/gpvaluetable-values/m-p/272063#M21019</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Every time I tried putting something in brackets it gave me an error because it wasn't the right type (str) so I started playing around with it and found that if I put this:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_macro_code jive_text_macro"&gt;param4.value = "text1;text2;text3"&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;It would split the text on the semicolon and have that fill out the first column of the table for 3 rows.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Then when I was playing around more I noticed that if I put a space then it would fill out the other columns:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_macro_code jive_text_macro"&gt;param4.value = "text1 text2 text3"&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;This would create 1 row with text in each of the 3 columns.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;From there I can split it like this:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_macro_code jive_text_macro"&gt;param4.value = "this" + " " +&amp;nbsp; "and" + " " +&amp;nbsp; "that""&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;So that I can replace the text for a variable to make the values change to what I want them to be.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Doesn't seem very efficient, but if it works I won't complain.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 25 Feb 2014 20:10:55 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/gpvaluetable-values/m-p/272063#M21019</guid>
      <dc:creator>JeffreyOwen1</dc:creator>
      <dc:date>2014-02-25T20:10:55Z</dc:date>
    </item>
    <item>
      <title>Re: GPValueTable values</title>
      <link>https://community.esri.com/t5/python-questions/gpvaluetable-values/m-p/1376274#M69753</link>
      <description>&lt;P&gt;I know this post is going on 10 years old, but I came across it and wanted to note a couple things in case other folks land here. &lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/145508"&gt;@JeffreyOwen1&lt;/a&gt;,&amp;nbsp;I do believe param4.columns should be of type "&lt;SPAN&gt;&lt;A href="https://pro.arcgis.com/en/pro-app/latest/arcpy/geoprocessing_and_python/defining-parameter-data-types-in-a-python-toolbox.htm#:~:text=String-,GPString,-A%20text%20value" target="_self"&gt;GPString&lt;/A&gt;" rather than "String."&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Further, to&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/65618"&gt;@FilipKrál&lt;/a&gt;&amp;nbsp;'s comment, the syntax of the first solution you posted worked for me (i.e., a single list&amp;nbsp;of multiple&amp;nbsp;items, nested in an outer list, as opposed to multiple lists nested in an outer list).&amp;nbsp; Note that it is indeed "values" with an "s" and not the singular form.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 31 Jan 2024 03:17:55 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/gpvaluetable-values/m-p/1376274#M69753</guid>
      <dc:creator>KennethEggeringAtStantec</dc:creator>
      <dc:date>2024-01-31T03:17:55Z</dc:date>
    </item>
  </channel>
</rss>

