I'm creating a script tool for ArcMap that will update a table from a file geodatabase. I'm having the first parameter (self.params[0]) autopopulate a dropdown. There may be multiple of the same entry in the first parameter. Therefore, in the def updateParemeters I've been unable to get the self.params[1] list to become the entries in the field that have the self.params[0]. I've tried SelectLayersbyAttribute and SearchCursors and can't figure it out. Thank you for your help!
<SPAN class="keyword token">import</SPAN> arcpy
<SPAN class="keyword token">class</SPAN> <SPAN class="token class-name">ToolValidator</SPAN><SPAN class="punctuation token">(</SPAN>object<SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">:</SPAN>
<SPAN class="string token">"""Class for validating a tool's parameter values and controlling
the behavior of the tool's dialog."""</SPAN>
<SPAN class="keyword token">def</SPAN> <SPAN class="token function">__init__</SPAN><SPAN class="punctuation token">(</SPAN>self<SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">:</SPAN>
<SPAN class="string token">"""Setup arcpy and the list of tool parameters."""</SPAN>
self<SPAN class="punctuation token">.</SPAN>params <SPAN class="operator token">=</SPAN> arcpy<SPAN class="punctuation token">.</SPAN>GetParameterInfo<SPAN class="punctuation token">(</SPAN><SPAN class="punctuation token">)</SPAN>
<SPAN class="keyword token">def</SPAN> <SPAN class="token function">initializeParameters</SPAN><SPAN class="punctuation token">(</SPAN>self<SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">:</SPAN>
<SPAN class="string token">"""Refine the properties of a tool's parameters. This method is
called when the tool is opened."""</SPAN>
clients <SPAN class="operator token">=</SPAN> <SPAN class="string token">"C:\geodata\Brush_Management_Plan.gdb\ClientInfo"</SPAN>
rows <SPAN class="operator token">=</SPAN> arcpy<SPAN class="punctuation token">.</SPAN>SearchCursor<SPAN class="punctuation token">(</SPAN>clients<SPAN class="punctuation token">)</SPAN>
self<SPAN class="punctuation token">.</SPAN>params<SPAN class="punctuation token">[</SPAN><SPAN class="number token">0</SPAN><SPAN class="punctuation token">]</SPAN><SPAN class="punctuation token">.</SPAN>filter<SPAN class="punctuation token">.</SPAN>list <SPAN class="operator token">=</SPAN> sorted<SPAN class="punctuation token">(</SPAN>list<SPAN class="punctuation token">(</SPAN>set<SPAN class="punctuation token">(</SPAN>c<SPAN class="punctuation token">.</SPAN>getValue<SPAN class="punctuation token">(</SPAN><SPAN class="string token">'Client'</SPAN><SPAN class="punctuation token">)</SPAN> <SPAN class="keyword token">for</SPAN> c <SPAN class="keyword token">in</SPAN> rows<SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">)</SPAN>
<SPAN class="keyword token">del</SPAN> rows
<SPAN class="keyword token">return</SPAN>
<SPAN class="keyword token">def</SPAN> <SPAN class="token function">updateParameters</SPAN><SPAN class="punctuation token">(</SPAN>self<SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">:</SPAN>
<SPAN class="string token">"""Modify the values and properties of parameters before internal
validation is performed. This method is called whenever a parameter
has been changed."""</SPAN>
<SPAN class="keyword token">if</SPAN> self<SPAN class="punctuation token">.</SPAN>params<SPAN class="punctuation token">[</SPAN><SPAN class="number token">0</SPAN><SPAN class="punctuation token">]</SPAN><SPAN class="punctuation token">.</SPAN>altered<SPAN class="punctuation token">:</SPAN>
table <SPAN class="operator token">=</SPAN> <SPAN class="string token">"C:\geodata\Brush_Management_Plan.gdb\ClientInfo"</SPAN>
client_field <SPAN class="operator token">=</SPAN> <SPAN class="string token">'Client'</SPAN>
contract_field <SPAN class="operator token">=</SPAN> <SPAN class="string token">'Contract_Num'</SPAN>
expression <SPAN class="operator token">=</SPAN> u<SPAN class="string token">'{} = 2'</SPAN><SPAN class="punctuation token">.</SPAN>format<SPAN class="punctuation token">(</SPAN>arcpy<SPAN class="punctuation token">.</SPAN>AddFieldDelimiters<SPAN class="punctuation token">(</SPAN>table<SPAN class="punctuation token">,</SPAN> client_field<SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">)</SPAN>
<SPAN class="keyword token">with</SPAN> arcpy<SPAN class="punctuation token">.</SPAN>da<SPAN class="punctuation token">.</SPAN>SearchCursor<SPAN class="punctuation token">(</SPAN>table<SPAN class="punctuation token">,</SPAN> <SPAN class="punctuation token">[</SPAN>client_field<SPAN class="punctuation token">,</SPAN> contract_field<SPAN class="punctuation token">]</SPAN><SPAN class="punctuation token">,</SPAN>
where_clause<SPAN class="operator token">=</SPAN>expression<SPAN class="punctuation token">)</SPAN> <SPAN class="keyword token">as</SPAN> cursor<SPAN class="punctuation token">:</SPAN>
<SPAN class="keyword token">for</SPAN> row <SPAN class="keyword token">in</SPAN> cursor<SPAN class="punctuation token">:</SPAN>
self<SPAN class="punctuation token">.</SPAN>params<SPAN class="punctuation token">[</SPAN><SPAN class="number token">1</SPAN><SPAN class="punctuation token">]</SPAN><SPAN class="punctuation token">.</SPAN>filter<SPAN class="punctuation token">.</SPAN>list <SPAN class="operator token">=</SPAN> sorted<SPAN class="punctuation token">(</SPAN>list<SPAN class="punctuation token">(</SPAN>set<SPAN class="punctuation token">(</SPAN>row<SPAN class="punctuation token">[</SPAN><SPAN class="number token">1</SPAN><SPAN class="punctuation token">]</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">)</SPAN>
<SPAN class="keyword token">return</SPAN>
<SPAN class="keyword token">def</SPAN> <SPAN class="token function">updateMessages</SPAN><SPAN class="punctuation token">(</SPAN>self<SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">:</SPAN>
<SPAN class="string token">"""Modify the messages created by internal validation for each tool
parameter. This method is called after internal validation."""</SPAN>
<SPAN class="keyword token">return</SPAN>
<SPAN class="line-numbers-rows"><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN></SPAN>