<?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 Import multiple values from model builder to script as a list of values in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/import-multiple-values-from-model-builder-to/m-p/1091680#M62168</link>
    <description>&lt;P&gt;As a complete beginner I recently started tinkering with modelbuilder and arcpy to solve a little annoying repetitive task. The model checks the highest number in a field and shows in a small window using a python script.&lt;/P&gt;&lt;P&gt;I get the values thrugh a SQL search by attribute and an summary statistics. The values end up as single strings in separate branches of the model, and I feed them to the script with arcpy.GetParameter()&lt;/P&gt;&lt;P&gt;For now I've used this with only two values as an example:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-SPOILER&gt;&lt;P&gt;import arcpy&lt;BR /&gt;import Tkinter&lt;BR /&gt;# Set local variables&lt;BR /&gt;Piano2 = arcpy.GetParameter(0)&lt;BR /&gt;Piano3 = arcpy.GetParameter(1)&lt;/P&gt;&lt;P&gt;parent_widget = Tkinter.Tk()&lt;BR /&gt;label_widget = Tkinter.Label(parent_widget, text= "Piano2 = " + Piano2 + "\nPiano3 = " + Piano3)&lt;BR /&gt;label_widget.pack()&lt;BR /&gt;Tkinter.mainloop()&lt;/P&gt;&lt;/LI-SPOILER&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When the tool is complete it will have around 30-60 variables that will vary depending on the situation.&lt;/P&gt;&lt;P&gt;What I want t do is instead of importing every value as a varaible, import a list of all values.&lt;/P&gt;&lt;P&gt;I tried with "collect values" and just "arcpy.GetParameter" the list but it doesn't seem to work.&lt;/P&gt;</description>
    <pubDate>Tue, 24 Aug 2021 13:07:59 GMT</pubDate>
    <dc:creator>Poncio</dc:creator>
    <dc:date>2021-08-24T13:07:59Z</dc:date>
    <item>
      <title>Import multiple values from model builder to script as a list of values</title>
      <link>https://community.esri.com/t5/python-questions/import-multiple-values-from-model-builder-to/m-p/1091680#M62168</link>
      <description>&lt;P&gt;As a complete beginner I recently started tinkering with modelbuilder and arcpy to solve a little annoying repetitive task. The model checks the highest number in a field and shows in a small window using a python script.&lt;/P&gt;&lt;P&gt;I get the values thrugh a SQL search by attribute and an summary statistics. The values end up as single strings in separate branches of the model, and I feed them to the script with arcpy.GetParameter()&lt;/P&gt;&lt;P&gt;For now I've used this with only two values as an example:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-SPOILER&gt;&lt;P&gt;import arcpy&lt;BR /&gt;import Tkinter&lt;BR /&gt;# Set local variables&lt;BR /&gt;Piano2 = arcpy.GetParameter(0)&lt;BR /&gt;Piano3 = arcpy.GetParameter(1)&lt;/P&gt;&lt;P&gt;parent_widget = Tkinter.Tk()&lt;BR /&gt;label_widget = Tkinter.Label(parent_widget, text= "Piano2 = " + Piano2 + "\nPiano3 = " + Piano3)&lt;BR /&gt;label_widget.pack()&lt;BR /&gt;Tkinter.mainloop()&lt;/P&gt;&lt;/LI-SPOILER&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When the tool is complete it will have around 30-60 variables that will vary depending on the situation.&lt;/P&gt;&lt;P&gt;What I want t do is instead of importing every value as a varaible, import a list of all values.&lt;/P&gt;&lt;P&gt;I tried with "collect values" and just "arcpy.GetParameter" the list but it doesn't seem to work.&lt;/P&gt;</description>
      <pubDate>Tue, 24 Aug 2021 13:07:59 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/import-multiple-values-from-model-builder-to/m-p/1091680#M62168</guid>
      <dc:creator>Poncio</dc:creator>
      <dc:date>2021-08-24T13:07:59Z</dc:date>
    </item>
    <item>
      <title>Re: Import multiple values from model builder to script as a list of values</title>
      <link>https://community.esri.com/t5/python-questions/import-multiple-values-from-model-builder-to/m-p/1091691#M62169</link>
      <description>&lt;P&gt;Collects Values tool will return a string of semicolon separated values such as&amp;nbsp;AA;BB;CC;DD.&lt;/P&gt;&lt;P&gt;It is up to you to split this string and process as you wish.&lt;/P&gt;&lt;P&gt;Example:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="DuncanHornby_0-1629811703224.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/21531iE4F69A566A210B37/image-size/medium?v=v2&amp;amp;px=400" role="button" title="DuncanHornby_0-1629811703224.png" alt="DuncanHornby_0-1629811703224.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 24 Aug 2021 13:28:36 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/import-multiple-values-from-model-builder-to/m-p/1091691#M62169</guid>
      <dc:creator>DuncanHornby</dc:creator>
      <dc:date>2021-08-24T13:28:36Z</dc:date>
    </item>
    <item>
      <title>Re: Import multiple values from model builder to script as a list of values</title>
      <link>https://community.esri.com/t5/python-questions/import-multiple-values-from-model-builder-to/m-p/1092134#M62174</link>
      <description>&lt;P&gt;Works perfectly! Thanks &lt;span class="lia-unicode-emoji" title=":grinning_face_with_smiling_eyes:"&gt;😄&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 25 Aug 2021 09:54:15 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/import-multiple-values-from-model-builder-to/m-p/1092134#M62174</guid>
      <dc:creator>Poncio</dc:creator>
      <dc:date>2021-08-25T09:54:15Z</dc:date>
    </item>
  </channel>
</rss>

