<?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: GDB Field Values to Script Value List in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/gdb-field-values-to-script-value-list/m-p/664973#M51643</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thanks, I got it!&amp;nbsp; I also forgot to include: &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; import os, sys, arcgisscripting&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; self.GP = arcgisscripting.create()&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 05 Apr 2011 13:12:52 GMT</pubDate>
    <dc:creator>DaveCouture</dc:creator>
    <dc:date>2011-04-05T13:12:52Z</dc:date>
    <item>
      <title>GDB Field Values to Script Value List</title>
      <link>https://community.esri.com/t5/python-questions/gdb-field-values-to-script-value-list/m-p/664970#M51640</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Is there a way to populate a String &lt;/SPAN&gt;&lt;STRONG&gt;Value List&lt;/STRONG&gt;&lt;SPAN&gt; (Filter) from the Values of a GDB Field?&amp;nbsp; We have hundreds of records in one of our GDB, that we update every month.&amp;nbsp; In our old system (Caris), we were able to create predefined queries (tools) for our users and I'm trying to create similar tools, with Scripts and the Model Builder.&amp;nbsp; For example, we had a drop down list with all the street names, in our city, and that list was being populated by the values of the StreetNames field, in the Streets MDB/ODBC (every time the tool is launched).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The Model Builder has a great tool called &lt;/SPAN&gt;&lt;STRONG&gt;Get Field Value&lt;/STRONG&gt;&lt;SPAN&gt;, but it only gets the first value of the field.&amp;nbsp; I really don't understand why the tool can't return multiple values - &lt;/SPAN&gt;&lt;STRONG&gt;Get Field ValueS&lt;/STRONG&gt;&lt;SPAN&gt;?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Any thoughts?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 03 Apr 2011 15:07:44 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/gdb-field-values-to-script-value-list/m-p/664970#M51640</guid>
      <dc:creator>DaveCouture</dc:creator>
      <dc:date>2011-04-03T15:07:44Z</dc:date>
    </item>
    <item>
      <title>Re: GDB Field Values to Script Value List</title>
      <link>https://community.esri.com/t5/python-questions/gdb-field-values-to-script-value-list/m-p/664971#M51641</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thanks! I understand how it works, now. I was able to define a filter, from the script; which is something I was also trying to do. However, I can't seem to get your code to work. I always get the following error: &lt;/SPAN&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;BR /&gt;ERROR &lt;BR /&gt;updateParameters Execution Error: Runtime error : 'Parameter' object has no attribute 'Filter'&lt;/STRONG&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Here's the whole script:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;class ToolValidator:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; """Class for validating a tool's parameter values and controlling&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; the behavior of the tool's dialog."""&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt; def __init__(self):&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; """Setup arcpy and the list of tool parameters."""&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; import arcpy&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; self.params = arcpy.GetParameterInfo()&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt; def initializeParameters(self):&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; """Refine the properties of a tool's parameters. This method is&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; called when the tool is opened."""&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; return&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt; def updateParameters(self):&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;STRONG&gt; try:&lt;BR /&gt; &lt;BR /&gt; rows=self.gp.searchcursor(self.params[0].Value)&lt;BR /&gt; row=rows.next()&lt;BR /&gt; KatKeyList=[]&lt;BR /&gt; &lt;BR /&gt; while row:&lt;BR /&gt; KatValue=row.getvalue("PID")&lt;BR /&gt; if KatValue not in KatKeyList:&lt;BR /&gt; KatKeyList.append(KatValue)&lt;BR /&gt; row=rows.next()&lt;BR /&gt; KatKeyList.sort(locale.strcoll)&lt;BR /&gt; del row, rows&lt;BR /&gt; self.params[1].Filter.List=KatKeyList&lt;BR /&gt; except:&lt;BR /&gt; self.params[1].Filter.List=[]&lt;/STRONG&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt; def updateMessages(self):&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; """Modify the messages created by internal validation for each tool&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; parameter. This method is called after internal validation."""&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; return&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 04 Apr 2011 23:13:22 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/gdb-field-values-to-script-value-list/m-p/664971#M51641</guid>
      <dc:creator>DaveCouture</dc:creator>
      <dc:date>2011-04-04T23:13:22Z</dc:date>
    </item>
    <item>
      <title>Re: GDB Field Values to Script Value List</title>
      <link>https://community.esri.com/t5/python-questions/gdb-field-values-to-script-value-list/m-p/664972#M51642</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Lower case 'f' on the param.filter attribute, and .list is lower case as well.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 04 Apr 2011 23:54:34 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/gdb-field-values-to-script-value-list/m-p/664972#M51642</guid>
      <dc:creator>JasonScheirer</dc:creator>
      <dc:date>2011-04-04T23:54:34Z</dc:date>
    </item>
    <item>
      <title>Re: GDB Field Values to Script Value List</title>
      <link>https://community.esri.com/t5/python-questions/gdb-field-values-to-script-value-list/m-p/664973#M51643</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thanks, I got it!&amp;nbsp; I also forgot to include: &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; import os, sys, arcgisscripting&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; self.GP = arcgisscripting.create()&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 05 Apr 2011 13:12:52 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/gdb-field-values-to-script-value-list/m-p/664973#M51643</guid>
      <dc:creator>DaveCouture</dc:creator>
      <dc:date>2011-04-05T13:12:52Z</dc:date>
    </item>
  </channel>
</rss>

