<?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 Iterate through list of parameterized field values in Model Builder? in Geoprocessing Questions</title>
    <link>https://community.esri.com/t5/geoprocessing-questions/iterate-through-list-of-parameterized-field-values/m-p/153692#M5169</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hello - I know there is a way but can't figure out how to do this in Model Builder.&amp;nbsp; Currently, my model accepts as a parameter a single feature class.&amp;nbsp; Later there is a Select statement that uses a hard coded field name in the query section to create a new feature class, and then the rest of the model runs, generating a single output feature class.&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Here is what I would like: once the user chooses the single input feature class, s/he can then create a list of different field names (based on that input feature class).&amp;nbsp; The field names in this list are used to populate the SQL query in the Select statement (each SQL query accepts only one field name).&amp;nbsp; The rest of the model runs once for each field name, and spits out the same number of output feature classes as there were input field names.&amp;nbsp; I hope that makes sense.&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Here is what I can't figure out:&amp;nbsp; 1.&amp;nbsp; How to create a variable that allows the user to create a list of fields based on the input feature class.&amp;nbsp; 2.&amp;nbsp; How to iterate through this list of field names, feeding them to the Select statement somehow so the rest of the model runs once per field name.&amp;nbsp; I can't tell if I need to use an iterator here (and which type of iterator) or a parameter that accepts a list of values, and how to connect it all so it works.&amp;nbsp; Any assistance would be of great help.&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 30 Sep 2011 13:23:18 GMT</pubDate>
    <dc:creator>JayGregory</dc:creator>
    <dc:date>2011-09-30T13:23:18Z</dc:date>
    <item>
      <title>Iterate through list of parameterized field values in Model Builder?</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/iterate-through-list-of-parameterized-field-values/m-p/153692#M5169</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hello - I know there is a way but can't figure out how to do this in Model Builder.&amp;nbsp; Currently, my model accepts as a parameter a single feature class.&amp;nbsp; Later there is a Select statement that uses a hard coded field name in the query section to create a new feature class, and then the rest of the model runs, generating a single output feature class.&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Here is what I would like: once the user chooses the single input feature class, s/he can then create a list of different field names (based on that input feature class).&amp;nbsp; The field names in this list are used to populate the SQL query in the Select statement (each SQL query accepts only one field name).&amp;nbsp; The rest of the model runs once for each field name, and spits out the same number of output feature classes as there were input field names.&amp;nbsp; I hope that makes sense.&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Here is what I can't figure out:&amp;nbsp; 1.&amp;nbsp; How to create a variable that allows the user to create a list of fields based on the input feature class.&amp;nbsp; 2.&amp;nbsp; How to iterate through this list of field names, feeding them to the Select statement somehow so the rest of the model runs once per field name.&amp;nbsp; I can't tell if I need to use an iterator here (and which type of iterator) or a parameter that accepts a list of values, and how to connect it all so it works.&amp;nbsp; Any assistance would be of great help.&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 30 Sep 2011 13:23:18 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/iterate-through-list-of-parameterized-field-values/m-p/153692#M5169</guid>
      <dc:creator>JayGregory</dc:creator>
      <dc:date>2011-09-30T13:23:18Z</dc:date>
    </item>
    <item>
      <title>Re: Iterate through list of parameterized field values in Model Builder?</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/iterate-through-list-of-parameterized-field-values/m-p/153693#M5170</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Check if this &lt;/SPAN&gt;&lt;A href="http://blogs.esri.com/Dev/blogs/geoprocessing/archive/2011/08/25/Generating-a-choice-list-from-a-field-.aspx"&gt;Blog&lt;/A&gt;&lt;SPAN&gt; helps with what you are trying to do. Download the script tool to generate a dynamic value list. You can use the tool as shown in the example. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If at all you want to output the field name as well, modify the script to have an additional derived output and set that derived output to be something like&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.SetParameter (4, InputField)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Then you can use both the field name and the field value in your SQL query as in-line variable substitution as shown in the blog example.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 03 Oct 2011 16:32:17 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/iterate-through-list-of-parameterized-field-values/m-p/153693#M5170</guid>
      <dc:creator>ShitijMehta</dc:creator>
      <dc:date>2011-10-03T16:32:17Z</dc:date>
    </item>
  </channel>
</rss>

