<?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: How to pass the iteration result to a parameter in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/how-to-pass-the-iteration-result-to-a-parameter/m-p/1023840#M59810</link>
    <description>&lt;P&gt;I'm not completely sure of what you mean, can you not just have the sde connection file as a parameter, then do whatever else within the script?&amp;nbsp;&lt;/P&gt;&lt;P&gt;What's the full script and what do you want to achieve?&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 05 Feb 2021 12:15:50 GMT</pubDate>
    <dc:creator>DavidPike</dc:creator>
    <dc:date>2021-02-05T12:15:50Z</dc:date>
    <item>
      <title>How to pass the iteration result to a parameter</title>
      <link>https://community.esri.com/t5/python-questions/how-to-pass-the-iteration-result-to-a-parameter/m-p/1023338#M59789</link>
      <description>&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;Hello everybody&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;I need to pass the list of domains that I have in the database in the script parameter. I didn’t find a suitable option in the data type. I decided to use ListDomains&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;import arcpy&lt;BR /&gt;a=set()&lt;BR /&gt;domains = arcpy.da.ListDomains("Database Connections\sde.sde")&lt;BR /&gt;for dom in domains:&lt;BR /&gt;&amp;nbsp; &amp;nbsp; a.add(dom.name)&lt;BR /&gt;arcpy.GetParameterAsText(0)&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;but this option doesn't work&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;how do i pass a list to a script parameter?&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 05 Feb 2021 07:01:03 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-to-pass-the-iteration-result-to-a-parameter/m-p/1023338#M59789</guid>
      <dc:creator>Sergey_Grechkin</dc:creator>
      <dc:date>2021-02-05T07:01:03Z</dc:date>
    </item>
    <item>
      <title>Re: How to pass the iteration result to a parameter</title>
      <link>https://community.esri.com/t5/python-questions/how-to-pass-the-iteration-result-to-a-parameter/m-p/1023347#M59790</link>
      <description>&lt;P&gt;&lt;A href="https://pro.arcgis.com/en/pro-app/latest/arcpy/geoprocessing_and_python/setting-script-tool-parameters.htm" target="_blank"&gt;Setting script tool parameters—ArcGIS Pro | Documentation&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If you look at the multivalue option it should be explained.&lt;/P&gt;</description>
      <pubDate>Thu, 04 Feb 2021 12:17:03 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-to-pass-the-iteration-result-to-a-parameter/m-p/1023347#M59790</guid>
      <dc:creator>DavidPike</dc:creator>
      <dc:date>2021-02-04T12:17:03Z</dc:date>
    </item>
    <item>
      <title>Re: How to pass the iteration result to a parameter</title>
      <link>https://community.esri.com/t5/python-questions/how-to-pass-the-iteration-result-to-a-parameter/m-p/1023803#M59809</link>
      <description>&lt;P&gt;I don’t understand how to specify for GetParameterAsText() the result of the iteration &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;/P&gt;&lt;P&gt;I try SetParameterAsText&lt;/P&gt;&lt;P&gt;But SetParameterAsText only works on output and is not displayed in the script window&lt;/P&gt;</description>
      <pubDate>Fri, 05 Feb 2021 06:38:05 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-to-pass-the-iteration-result-to-a-parameter/m-p/1023803#M59809</guid>
      <dc:creator>Sergey_Grechkin</dc:creator>
      <dc:date>2021-02-05T06:38:05Z</dc:date>
    </item>
    <item>
      <title>Re: How to pass the iteration result to a parameter</title>
      <link>https://community.esri.com/t5/python-questions/how-to-pass-the-iteration-result-to-a-parameter/m-p/1023840#M59810</link>
      <description>&lt;P&gt;I'm not completely sure of what you mean, can you not just have the sde connection file as a parameter, then do whatever else within the script?&amp;nbsp;&lt;/P&gt;&lt;P&gt;What's the full script and what do you want to achieve?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 05 Feb 2021 12:15:50 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-to-pass-the-iteration-result-to-a-parameter/m-p/1023840#M59810</guid>
      <dc:creator>DavidPike</dc:creator>
      <dc:date>2021-02-05T12:15:50Z</dc:date>
    </item>
    <item>
      <title>Re: How to pass the iteration result to a parameter</title>
      <link>https://community.esri.com/t5/python-questions/how-to-pass-the-iteration-result-to-a-parameter/m-p/1024298#M59829</link>
      <description>&lt;P&gt;David I solved my problem&lt;BR /&gt;I wrote in validation&lt;/P&gt;&lt;P&gt;def initializeParameters(self):&lt;BR /&gt;"""Refine the properties of a tool's parameters. This method is&lt;BR /&gt;called when the tool is opened."""&lt;BR /&gt;domains = arcpy.da.ListDomains("Database Connections\sde.sde")&lt;BR /&gt;my=[]&lt;BR /&gt;for domain in domains:&lt;BR /&gt;my.append(domain.name)&lt;BR /&gt;self.params[3].filter.list=sorted(my)&lt;BR /&gt;return&lt;/P&gt;&lt;P&gt;Now the parameter displays a list of the required data&lt;/P&gt;&lt;P&gt;import arcpy&lt;/P&gt;&lt;P&gt;fc = arcpy.GetParameterAsText(0)&amp;nbsp;&lt;BR /&gt;field = arcpy.GetParameterAsText(1)&amp;nbsp;&lt;BR /&gt;domain_1 = arcpy.GetParameterAsText(3)&amp;nbsp;&lt;BR /&gt;domain_2 = arcpy.da.ListDomains("Database Connections\sde.sde")&lt;BR /&gt;field_1 = arcpy.GetParameterAsText(2)&amp;nbsp;&lt;BR /&gt;cursor = arcpy.SearchCursor(fc)&lt;/P&gt;&lt;P&gt;b=set()&amp;nbsp;&lt;BR /&gt;a=set()&lt;BR /&gt;for domain in domain_2:&lt;BR /&gt;if domain.name == domain_1:&lt;BR /&gt;for val in domain.codedValues.keys():&lt;BR /&gt;b.add(val)&lt;BR /&gt;with open(r'R:\{}.txt'.format(field), 'w') as f:&lt;BR /&gt;for row in cursor:&lt;BR /&gt;k=row.getValue(field)&lt;BR /&gt;if k not in b:&lt;BR /&gt;a.add(row.getValue(field_1))&lt;BR /&gt;if len(a)&amp;gt;0:&lt;BR /&gt;f.write ('COLUMN {} IS NOT FILLED BY STANDARD'.format(field)+'\n')&lt;BR /&gt;for val in a:&lt;BR /&gt;f.write ('{}'.format(val)+'\n')&lt;BR /&gt;else:&lt;BR /&gt;f.write ('COLUMN {} FILLED BY STANDARD'.format(field)+'\n')&lt;/P&gt;</description>
      <pubDate>Mon, 08 Feb 2021 11:07:37 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-to-pass-the-iteration-result-to-a-parameter/m-p/1024298#M59829</guid>
      <dc:creator>Sergey_Grechkin</dc:creator>
      <dc:date>2021-02-08T11:07:37Z</dc:date>
    </item>
  </channel>
</rss>

