<?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: Can I return a list of attribute values from a geoprocessing service? in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/can-i-return-a-list-of-attribute-values-from-a/m-p/85#M23</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;the variable you have as 'result' would be what you'd reference in place of the select_by_location_layer, so that search cursor would look more like the following:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;rows = arcpy.SearchCursor(result,"","","DistrictNum")&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;here's an implementation of that concept that i use to select features by location, then creates a .lyr file on disk.&amp;nbsp; The search cursor is used to collect the IDs of the selected values and those are then used to created a definition query in the .lyr file.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;PAZ_lyr = 'feature_layer' # feature layer created as a global variable
def make_paz_layer(keyhole):
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; paz_units = []
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SelPaz = arcpy.SelectLayerByLocation_management (PAZ_lyr, 'Intersect', keyhole)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; rows = arcpy.SearchCursor(SelPaz," \"POWERPLANT\" = 'PlantName'", "", "PAZ;PAZ_NUM;PAZ_ALPHA","PAZ_NUM A;PAZ_ALPHA A")
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; for row in rows:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; unit = str(row.PAZ)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; unum = "'" + unit + "'" #wraps each value in single quotes
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; paz_units.append(unum)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; txt_paz = ','.join(paz_units) #creates a comma separated string out of a ist
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; paz_list = '(' + txt_paz + ')' #encloses the string inside parentheses to be used in the definition query
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; paz_qry = ' "POWERPLANT" = '+ station_name + ' AND "PAZ" in ' + paz_list
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; new_paz = arcpy.MakeFeatureLayer_management(paz, keyhole + '_paz', paz_qry)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.SaveToLayerFile_management(new_paz, outfolder + '\\' + keyhole + '_paz.lyr')&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 10 Dec 2021 20:01:29 GMT</pubDate>
    <dc:creator>ChristopherThompson</dc:creator>
    <dc:date>2021-12-10T20:01:29Z</dc:date>
    <item>
      <title>Can I return a list of attribute values from a geoprocessing service?</title>
      <link>https://community.esri.com/t5/python-questions/can-i-return-a-list-of-attribute-values-from-a/m-p/82#M20</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I have been asked to create a service that will be consumed by a non-GIS application.&amp;nbsp;&amp;nbsp; The programmer wants to be able to "make a call to GIS" providing the number of a school district as input.&amp;nbsp; They want the service to return just a list of districts that surround the input number.&amp;nbsp; Their application will be written in Java, which I know nothing about.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have considered publishing a model as a geoprocessing service and I have looked at Python.&amp;nbsp; It seems like I might have more luck in Python, which I've never used before, because at least I could make an array or list of values from the attributes?&amp;nbsp; I'm not finding much documentation on publishing a Python script as a geoprocessing service.&amp;nbsp; I assume I can do this?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I started by creating a model that had the tools select by attribute and select by location.&amp;nbsp;&amp;nbsp; Then I exported this to Python.&amp;nbsp; It executes OK when I'm in ArcMap.&amp;nbsp;&amp;nbsp; I'm not sure where to go from there.&amp;nbsp; I know I need to examine each polygon that is the result of the select by location query and find just the attribute of the district field.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;There is no desire to view or create a map in this application.&amp;nbsp; They just want a list containing the numbers of the adjacent districts.&amp;nbsp; Even after I get the list,&amp;nbsp; I'm still not sure what I might need to do to get this to work properly as an ArcGIS Server geoprocessing service.&amp;nbsp; I am still at version 10.0. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;# --------------------------------------------------------------------------- # adjacent.py # Created on: 2012-07-12 15:14:17.00000 #&amp;nbsp;&amp;nbsp; (generated by ArcGIS/ModelBuilder) # Usage: adjacent &amp;lt;countyName&amp;gt;&amp;nbsp; # Description:&amp;nbsp; # ---------------------------------------------------------------------------&amp;nbsp; # Import arcpy module import arcpy&amp;nbsp; # Set Geoprocessing environments arcpy.env.scratchWorkspace = "C:\\ESRItest\\model\\process.gdb" arcpy.env.workspace = "C:\\ESRItest\\model\\process.gdb"&amp;nbsp; # Script arguments countyName = arcpy.GetParameterAsText(0) if countyName == '#' or not countyName: &amp;nbsp;&amp;nbsp;&amp;nbsp; countyName = "Boone" # provide a default value if unspecified&amp;nbsp; # Local variables: selected_County = countyName Adjacent_Counties = selected_County county = "county"&amp;nbsp; # Process: Select Layer By Attribute arcpy.SelectLayerByAttribute_management(county, "NEW_SELECTION", "\"NAME\" = '%countyName%'")&amp;nbsp; # Process: Select Layer By Location result = arcpy.SelectLayerByLocation_management(selected_County, "BOUNDARY_TOUCHES", "", "", "NEW_SELECTION")&amp;nbsp; ## NOW WHAT?&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 13 Jul 2012 13:03:45 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/can-i-return-a-list-of-attribute-values-from-a/m-p/82#M20</guid>
      <dc:creator>TracySchloss</dc:creator>
      <dc:date>2012-07-13T13:03:45Z</dc:date>
    </item>
    <item>
      <title>Re: Can I return a list of attribute values from a geoprocessing service?</title>
      <link>https://community.esri.com/t5/python-questions/can-i-return-a-list-of-attribute-values-from-a/m-p/83#M21</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;You're on the right track here, just a few more steps to go.&amp;nbsp; Once you have the select by location layer you can implement a search cursor to inspect each feature selected and then collect those values into a list.&amp;nbsp; Generically this might look something like this:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;(in my fictional example the district number is held in a field named DistrictNum)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;list_of_districts = [] #creates an empty list of the districts that you will fill
rows = arcpy.SearchCursor(select_by_location_layer,"","","DistrictNum") # sets up a search cursor that allows you to move row by row

for row in rows:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; dist_id = row.DistrictNum
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; list_of_districts.append(dist_id)&lt;/PRE&gt;&lt;BR /&gt;&lt;SPAN&gt;thats it.&amp;nbsp; There are a number of ways to approach this but you'll want to start by reading up about the SearchCursor syntax.&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;You'll also need to figure out how to deal with the list that is accumulated.&amp;nbsp; One option would be to write it to a text file in an operation that would look something like this:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;dist_num_file = open(r'c:\districts.txt','a') #creates and opens a file on disk for appending to
for x in list_of_districts:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; dist_num_file.write(x + '\n')&amp;nbsp; #the \n places a carriage return so each district value is put on a separate line

dist_num_file.close()&lt;/PRE&gt;&lt;SPAN&gt;The key concepts you'll want to master for this sort of thing are search cursors, iteration concepts, use the python for loop, file objects (creating, reading, writing, etc.), and text string manipulation.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I noticed on posting that the indentation that i'd put in wasn't preserved, so thats something you'll have to pay attention to within python because indentation is critical in that environment.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Dec 2021 20:01:27 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/can-i-return-a-list-of-attribute-values-from-a/m-p/83#M21</guid>
      <dc:creator>ChristopherThompson</dc:creator>
      <dc:date>2021-12-10T20:01:27Z</dc:date>
    </item>
    <item>
      <title>Re: Can I return a list of attribute values from a geoprocessing service?</title>
      <link>https://community.esri.com/t5/python-questions/can-i-return-a-list-of-attribute-values-from-a/m-p/84#M22</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;So where is select_by_location_layer defined?&amp;nbsp;&amp;nbsp; I was thinking I would need to set a variable on the Select Layer by Location, which is why I changed the line below to have results = in it.&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_macro_code jive_text_macro"&gt;result = arcpy.SelectLayerByLocation_management(selected_County, "BOUNDARY_TOUCHES", "", "", "NEW_SELECTION")&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 13 Jul 2012 14:55:03 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/can-i-return-a-list-of-attribute-values-from-a/m-p/84#M22</guid>
      <dc:creator>TracySchloss</dc:creator>
      <dc:date>2012-07-13T14:55:03Z</dc:date>
    </item>
    <item>
      <title>Re: Can I return a list of attribute values from a geoprocessing service?</title>
      <link>https://community.esri.com/t5/python-questions/can-i-return-a-list-of-attribute-values-from-a/m-p/85#M23</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;the variable you have as 'result' would be what you'd reference in place of the select_by_location_layer, so that search cursor would look more like the following:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;rows = arcpy.SearchCursor(result,"","","DistrictNum")&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;here's an implementation of that concept that i use to select features by location, then creates a .lyr file on disk.&amp;nbsp; The search cursor is used to collect the IDs of the selected values and those are then used to created a definition query in the .lyr file.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;PAZ_lyr = 'feature_layer' # feature layer created as a global variable
def make_paz_layer(keyhole):
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; paz_units = []
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SelPaz = arcpy.SelectLayerByLocation_management (PAZ_lyr, 'Intersect', keyhole)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; rows = arcpy.SearchCursor(SelPaz," \"POWERPLANT\" = 'PlantName'", "", "PAZ;PAZ_NUM;PAZ_ALPHA","PAZ_NUM A;PAZ_ALPHA A")
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; for row in rows:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; unit = str(row.PAZ)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; unum = "'" + unit + "'" #wraps each value in single quotes
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; paz_units.append(unum)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; txt_paz = ','.join(paz_units) #creates a comma separated string out of a ist
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; paz_list = '(' + txt_paz + ')' #encloses the string inside parentheses to be used in the definition query
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; paz_qry = ' "POWERPLANT" = '+ station_name + ' AND "PAZ" in ' + paz_list
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; new_paz = arcpy.MakeFeatureLayer_management(paz, keyhole + '_paz', paz_qry)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.SaveToLayerFile_management(new_paz, outfolder + '\\' + keyhole + '_paz.lyr')&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Dec 2021 20:01:29 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/can-i-return-a-list-of-attribute-values-from-a/m-p/85#M23</guid>
      <dc:creator>ChristopherThompson</dc:creator>
      <dc:date>2021-12-10T20:01:29Z</dc:date>
    </item>
    <item>
      <title>Re: Can I return a list of attribute values from a geoprocessing service?</title>
      <link>https://community.esri.com/t5/python-questions/can-i-return-a-list-of-attribute-values-from-a/m-p/86#M24</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;That helps, thanks.&amp;nbsp; All I really need is the list of values and I don't want it in an output file or anything, I want it to be the result of a call to a geoprocessing service. I'm still trying to wrap my head around how to get the list to be the result of my geoprocessing call. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I'm not sure where to even post this question, it's touching on script syntax and ArcGIS Server geoprocessing services.&amp;nbsp; From my searching, I'm not finding a lot of examples, but it still seems like it should be possible.&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;# ---------------------------------------------------------------------------
# adjacent.py
# Created on: 2012-07-12 15:14:17.00000
#&amp;nbsp;&amp;nbsp; (generated by ArcGIS/ModelBuilder)
# Usage: adjacent &amp;lt;countyName&amp;gt; 
# Description: 
# ---------------------------------------------------------------------------

# Import arcpy module
import arcpy

# Set Geoprocessing environments
arcpy.env.scratchWorkspace = "C:/ESRItest/model/process.gdb"
arcpy.env.workspace = "C:/ESRItest/model/process.gdb"

# Script arguments
countyName = arcpy.GetParameterAsText(0)
if countyName == '#' or not countyName:
&amp;nbsp;&amp;nbsp;&amp;nbsp; countyName = "Boone" # provide a default value if unspecified

# Local variables:
selected_County = countyName
Adjacent_Counties = selected_County
county = "county"
countList = []&amp;nbsp;&amp;nbsp; #&amp;nbsp; I added this
countyField = "NAME"&amp;nbsp; #I added this

# Process: Select Layer By Attribute
arcpy.SelectLayerByAttribute_management(county, "NEW_SELECTION", "\"NAME\" = '%countyName%'")

# Process: Select Layer By Location
results = arcpy.SelectLayerByLocation_management(selected_County, "BOUNDARY_TOUCHES", "", "", "NEW_SELECTION")

## I added this section 7-13-12
rows = arcpy.SearchCursor(results,"","","NAME")
for row in rows:
 neighborVal = row.NAME
 print(neighborVal)
 countyList.append(neighborVal)
 txt_list = ','.join(countyList)
print txt_list&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Dec 2021 20:01:32 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/can-i-return-a-list-of-attribute-values-from-a/m-p/86#M24</guid>
      <dc:creator>TracySchloss</dc:creator>
      <dc:date>2021-12-10T20:01:32Z</dc:date>
    </item>
    <item>
      <title>Re: Can I return a list of attribute values from a geoprocessing service?</title>
      <link>https://community.esri.com/t5/python-questions/can-i-return-a-list-of-attribute-values-from-a/m-p/87#M25</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Well, I guess the question you have to define an answer for is what you do with that list once you have it.&amp;nbsp; Does it get passed into another program? if your developer wants that list, then you want to put that geoprocessing service inside a python function that returns the list, probably formatted as a text string as&amp;nbsp; you've done.&amp;nbsp; That would take the form in python of doing something like this:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;def GetDistricts(args): #where args are values you'd pass in if there were any
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ...code to do stuff
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; txt_list = ','.join(countyList)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return txt_list&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;within a python script you'd use that bit of code like this:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;mylist = GetDistricts(args you pass in)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;then mylist takes the values created in the txt_list variable.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;How you pass that into your developer's Java application which i also know nothing about so you'll have to talk with that person about how to call a python script and have it pass out that string.&amp;nbsp; If you'd like to email me more about this please do.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;chris thompson&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Dec 2021 20:01:35 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/can-i-return-a-list-of-attribute-values-from-a/m-p/87#M25</guid>
      <dc:creator>ChristopherThompson</dc:creator>
      <dc:date>2021-12-10T20:01:35Z</dc:date>
    </item>
    <item>
      <title>Re: Can I return a list of attribute values from a geoprocessing service?</title>
      <link>https://community.esri.com/t5/python-questions/can-i-return-a-list-of-attribute-values-from-a/m-p/88#M26</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I was actually thinking of it the other way.&amp;nbsp; I have a geoprocessing service that is built from Python that would be called from another program.&amp;nbsp; I've used the other ArcGIS Server tasks like findTask, queryTask, locatorTask.&amp;nbsp; For those, you have a service that you can pass it a parameter and what it returns in in the form of JSON or HTML.&amp;nbsp; Once you start creating your own geoprocessing service, I assume whatever is returned is going to be determined more from what output or results you have from the script. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have to take a step back for the moment because I have two different versions of Python on my machine and they seem to be conflicting with each other!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 13 Jul 2012 16:53:21 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/can-i-return-a-list-of-attribute-values-from-a/m-p/88#M26</guid>
      <dc:creator>TracySchloss</dc:creator>
      <dc:date>2012-07-13T16:53:21Z</dc:date>
    </item>
    <item>
      <title>Re: Can I return a list of attribute values from a geoprocessing service?</title>
      <link>https://community.esri.com/t5/python-questions/can-i-return-a-list-of-attribute-values-from-a/m-p/89#M27</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I was able to get my python install problem taken care of.&amp;nbsp; Tech support recommended a repair on the install.&amp;nbsp; I probably could have just fixed it by just editing the system variable for PYTHONPATH.&amp;nbsp; Anyway, I'm back in business.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;My code doesn't seem to actually return anything.&amp;nbsp; In my example, I'm just using county boundaries, because there are fewer of those and I have the data at hand.&amp;nbsp; I need to do some more reading on debugging.&amp;nbsp; I don't see that the array I created even gets any values in my searchCursor.&amp;nbsp; The selections by attribute and by location seem to be occuring.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;# ---------------------------------------------------------------------------
# adjacent.py
# Created on: 2012-07-12 15:14:17.00000
#&amp;nbsp;&amp;nbsp; (generated by ArcGIS/ModelBuilder)
# Usage: adjacent &amp;lt;countyName&amp;gt; 
# Description: 
# ---------------------------------------------------------------------------

# Import arcpy module
import arcpy

# Set Geoprocessing environments
arcpy.env.scratchWorkspace = "C:/ESRItest/model/process.gdb"
arcpy.env.workspace = "C:/ESRItest/model/process.gdb"

#overwrite pre-existing files
arcpy.env.overwriteOutput = True

# Script arguments
countyName = arcpy.GetParameterAsText(0)
if countyName == '#' or not countyName:
&amp;nbsp;&amp;nbsp;&amp;nbsp; countyName = "Boone" # provide a default value if unspecified

# Local variables:
selected_County = countyName
Adjacent_Counties = selected_County
#county = "county"
county = "C:/ESRItest/model/process.gdb/county"
Output_Layer = "county_Layer"
countList = []&amp;nbsp;&amp;nbsp; #&amp;nbsp; I added this
countyField = "NAME"&amp;nbsp; #I added this
county_lyr = "C:/ESRItest/model/county.lyr"

# Process: Make Feature Layer
arcpy.MakeFeatureLayer_management(county, Output_Layer, "", "", "OBJECTID OBJECTID VISIBLE NONE;Shape Shape VISIBLE NONE;NAME NAME VISIBLE NONE;CNTY_FIPS CNTY_FIPS VISIBLE NONE;FIPS FIPS VISIBLE NONE;POP2005 POP2005 VISIBLE NONE;POP05_SQMI POP05_SQMI VISIBLE NONE;SQMI SQMI VISIBLE NONE;NAME2 NAME2 VISIBLE NONE;Shape_Length Shape_Length VISIBLE NONE;Shape_Area Shape_Area VISIBLE NONE")

# Process: Select Layer By Attribute
selection = arcpy.SelectLayerByAttribute_management(Output_Layer, "NEW_SELECTION", "\"NAME\" = '%countyName%'")

# Process: Select Layer By Location
results = arcpy.SelectLayerByLocation_management(selection, "BOUNDARY_TOUCHES", "", "", "NEW_SELECTION")

# Process: Select Layer By Attribute
#arcpy.SelectLayerByAttribute_management("C:/ESRItest/model/process.gdb/county", "NEW_SELECTION", "\"NAME\" = '%countyName%'")



## I added this section 7-13-12
rows = arcpy.SearchCursor(results,"","","NAME","NAME")
for row in rows:
&amp;nbsp;&amp;nbsp;&amp;nbsp; neighborVal = row.getValue("NAME")
&amp;nbsp;&amp;nbsp;&amp;nbsp; print(neighborVal)
&amp;nbsp;&amp;nbsp;&amp;nbsp; countyList.append(neighborVal)
&amp;nbsp;&amp;nbsp;&amp;nbsp; print countyList
#txt_list = ','.join(countyList)&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Dec 2021 20:01:37 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/can-i-return-a-list-of-attribute-values-from-a/m-p/89#M27</guid>
      <dc:creator>TracySchloss</dc:creator>
      <dc:date>2021-12-10T20:01:37Z</dc:date>
    </item>
    <item>
      <title>Re: Can I return a list of attribute values from a geoprocessing service?</title>
      <link>https://community.esri.com/t5/python-questions/can-i-return-a-list-of-attribute-values-from-a/m-p/90#M28</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I just skimmed through this thread and the questions proposed by Chris a couple posts up "what are you doing with this list, what program will consume this list" I think have to be answered before you move forward.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;The cursor is approach is fine, but is it really needed? I can't envision a cursor result as output to a GP Service that would be usable by a client (note I say I cant imagine, not it can't be done)....&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;From your very first post you looked to be doing select on a feature and want to pass that result.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Well regardless of it its a table, or featureclass, you get attributes back (I assume that is what you're ultimately after) from further posts.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;You did mention JSON. So, if you Java developer says "sure, I can take a JSON list and get what I need from it".... you're pretty much done.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Tell him how to connect to the REST end point, execute your service, load the output into some sort of JSON object and parse it.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Of course you could do them a favor by trimming the amount you output by only returning a table/features with just the fields they need (else they might be parsing more then they want to).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;As an example, I used the Copy Rows tool, published it, and the output when requested as JSON comes back like:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt; {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "attributes": {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "OID": 1,
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "LABNO": "C-117267",
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "CATEGORY": "NURE",
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "DATASET": "NURE Coastal 98",
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "TYPEDESC": "STRM-SED-DRY",
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "COUNT_": 118,
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "PB_ICP40": 12
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/PRE&gt;&lt;BR /&gt;&lt;SPAN&gt;Hopefully this helps, you're on the right track, I just think you need to confirm with your java developer what they want, or what they can use.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Dec 2021 20:01:40 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/can-i-return-a-list-of-attribute-values-from-a/m-p/90#M28</guid>
      <dc:creator>KevinHibma</dc:creator>
      <dc:date>2021-12-10T20:01:40Z</dc:date>
    </item>
    <item>
      <title>Re: Can I return a list of attribute values from a geoprocessing service?</title>
      <link>https://community.esri.com/t5/python-questions/can-i-return-a-list-of-attribute-values-from-a/m-p/91#M29</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I've altered that last bit in your example to address a couple of things.&amp;nbsp; What i'm seeing is:&lt;/SPAN&gt;&lt;BR /&gt;&lt;UL&gt;&lt;BR /&gt;you're trying to append to a list that doesn't exist (countyList) - this should be created as an empty element outside yoru loop&lt;/UL&gt;&lt;UL&gt;&lt;BR /&gt;assigning a value to neighborVal doesn't look right - it should use row.FIELDNAME instead of getValue('NAME') method you are using&lt;/UL&gt;&lt;BR /&gt;&lt;SPAN&gt;I also added some code to write the results to a txt file that you can inspect after the fact; you just need to replace the XXX with a directory path where to write that file to.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;here is the code:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;## try this version by ct 7/18/12
countyList = [] # this creates an empty python list for you to append values to
# creating this outside the loop makes sure that it can be used outside the loop because of scope issues
rows = arcpy.SearchCursor(results,"","","NAME","NAME")
for row in rows:
&amp;nbsp;&amp;nbsp;&amp;nbsp; neighborVal = row.NAME
&amp;nbsp;&amp;nbsp;&amp;nbsp; print(neighborVal)
&amp;nbsp;&amp;nbsp;&amp;nbsp; countyList.append(neighborVal)
&amp;nbsp;&amp;nbsp;&amp;nbsp; print countyList
#txt_list = ','.join(countyList)
mydir = r'XXXXX' # put in a directory path here that you can write a text file to
outdoc = open(mydir + '\\results.txt','a')
outdoc.write(txt_list + '\n')
outdoc.close()&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;That txt file could potentially even be the object that the java script your developer grabs to use in his application, unless there is a way to pass the contents of txt_list into his application directly without having to write a file to disk (which raises file management and processing time issues).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I'll be interested to know if this will work for you.&amp;nbsp; Khimba's approach is potentially another way to do this of course, but also involves paring down the result table to just the values you need to know. Good luck!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Dec 2021 20:01:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/can-i-return-a-list-of-attribute-values-from-a/m-p/91#M29</guid>
      <dc:creator>ChristopherThompson</dc:creator>
      <dc:date>2021-12-10T20:01:42Z</dc:date>
    </item>
    <item>
      <title>Re: Can I return a list of attribute values from a geoprocessing service?</title>
      <link>https://community.esri.com/t5/python-questions/can-i-return-a-list-of-attribute-values-from-a/m-p/92#M30</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;My original thought process was the one that Kevin is describing.&amp;nbsp; The request that was made to us was "we want to make a call to GIS with a school district number and get returned back to our program as a list of adjacent school district numbers in a comma delimited format".&amp;nbsp;&amp;nbsp; My sample code is county boundaries instead, because I had those already created.&amp;nbsp; (The school districts are in the process of being updated. )&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;When I was first handed this request, I thought it was more map centric and wrote a small FLEX app to do this (my only area of real programming expertise).&amp;nbsp; However, they don't WANT to interact with the map.&amp;nbsp; Per the last conversation we had "They just want a list". Even Copy Rows is going to require them to parse the JSON output to retrieve just the district ID from each of the rows.&amp;nbsp; I figure they are going to have to figure out themselves how to parse what GIS can output.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Part of my problem seems to be that my original code doesn't seem to be selecting anything when I run it as Python.&amp;nbsp; I need to go back to my original model and see if it was truly executing.&amp;nbsp; It's just a select by attribute with that output passed as the input to select by location - it ought to be a piece of cake!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Jul 2012 12:30:55 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/can-i-return-a-list-of-attribute-values-from-a/m-p/92#M30</guid>
      <dc:creator>TracySchloss</dc:creator>
      <dc:date>2012-07-19T12:30:55Z</dc:date>
    </item>
    <item>
      <title>Re: Can I return a list of attribute values from a geoprocessing service?</title>
      <link>https://community.esri.com/t5/python-questions/can-i-return-a-list-of-attribute-values-from-a/m-p/93#M31</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Ok, since you know exactly what they want, you have 2 options (that I can see anyway).&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Once you get your select working, you're done - have them parse your JSON. &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Or, if you're in a helping mood, take the suggestion from Chris which uses a cursor, grab the required IDs and build them into a string. Make the output of your service just that - a comma delimited string.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Jul 2012 15:49:08 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/can-i-return-a-list-of-attribute-values-from-a/m-p/93#M31</guid>
      <dc:creator>KevinHibma</dc:creator>
      <dc:date>2012-07-19T15:49:08Z</dc:date>
    </item>
    <item>
      <title>Re: Can I return a list of attribute values from a geoprocessing service?</title>
      <link>https://community.esri.com/t5/python-questions/can-i-return-a-list-of-attribute-values-from-a/m-p/94#M32</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;looking back at your original code the biggest issue is that as it appears in your posting, there isn't a feature class being referenced anywhere&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Select by Attributes references some text named "county" and Selecty by Location references something called selectedCounty which is simply the text value of the county name. The code should look something like this:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;county = 'filepath to a feature class on disk'

# Process: Select Layer By Attribute
county_selection = arcpy.SelectLayerByAttribute_management(county, "NEW_SELECTION", "\"NAME\" = '%countyName%'")

# Process: Select Layer By Location
result = arcpy.SelectLayerByLocation_management(county_selection, "BOUNDARY_TOUCHES", "", "", "NEW_SELECTION")&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;in this example, county is an object that references an on disk feature class and is used in the Select by Attribute process to create an object named county_selection.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;county_selection is then passed in to the Select by Location process which creates the object result which gets used by the search cursor that we discussed earlier.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Its possilbe that county needs to be a feature layer in which case you would do something like this:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;county = arcpy.MakeFeatureLayer_management(&amp;lt;feature class on disk&amp;gt;, "outlayer name")&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 15:53:40 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/can-i-return-a-list-of-attribute-values-from-a/m-p/94#M32</guid>
      <dc:creator>ChristopherThompson</dc:creator>
      <dc:date>2021-12-12T15:53:40Z</dc:date>
    </item>
    <item>
      <title>Re: Can I return a list of attribute values from a geoprocessing service?</title>
      <link>https://community.esri.com/t5/python-questions/can-i-return-a-list-of-attribute-values-from-a/m-p/95#M33</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I did realize somewhere along the way that I couldn't use a featureclass as input.&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I'm getting confused on whether I should run this&amp;nbsp; from the python shell or if I can run it as a script in a toolbox.&amp;nbsp; If I run it as a script, it gives me the prompt I expect for the name, but it doesn't seem to return anything.&amp;nbsp; There aren't any errors, either.&amp;nbsp; I'm not sure there's even a place for my results to go since it's just returning a list and not anything like a layer or table.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If I run it through the shell, then when do I specify my input string to search on? &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Also I'm wondering about the syntax of my expression in select by attributes.&amp;nbsp; When I tried hard coding in a county name "NAME" = 'Holt', it created my output list (YEAH!).&amp;nbsp; But when I put back it back in as a variable, it doesn't list anything (BOO!)&amp;nbsp; I had a few lines in there for CopyFeatures, but I don't really think I need that, so I commented it out.&amp;nbsp; Since select by attribute isn't finding anything, then select by location logically isn't either and I end up finding nothing.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;# ---------------------------------------------------------------------------
# adjacent.py
# Created on: 2012-07-12 15:14:17.00000
#&amp;nbsp;&amp;nbsp; (generated by ArcGIS/ModelBuilder)
# Usage: adjacent &amp;lt;countyName&amp;gt; 
# Description: 
# ---------------------------------------------------------------------------

# Import arcpy module
import arcpy

# Set Geoprocessing environments
arcpy.env.scratchWorkspace = "C:\\ESRItest\\model\\process.gdb"
arcpy.env.workspace = "C:\\ESRItest\\model\\process.gdb"

#overwrite pre-existing files
arcpy.env.overwriteOutput = True

# Script arguments
countyName = arcpy.GetParameterAsText(0)
if countyName == '#' or not countyName:
&amp;nbsp;&amp;nbsp;&amp;nbsp; countyName = "Boone" # provide a default value if unspecified

# Local variables:
county = "county"
county_Layer = "county_Layer"
countyList = []

txt_list = ""
#Output_Feature_Class = "C:\\ESRItest\\model\\process.gdb\\county_CopyFeaturesOutput"

# Process: Make Feature Layer
county_Layer = arcpy.MakeFeatureLayer_management("C:\ESRItest\model\process.gdb\county", county_Layer, "", "", "OBJECTID OBJECTID VISIBLE NONE;Shape Shape VISIBLE NONE;NAME NAME VISIBLE NONE;CNTY_FIPS CNTY_FIPS VISIBLE NONE;FIPS FIPS VISIBLE NONE;POP2005 POP2005 VISIBLE NONE;POP05_SQMI POP05_SQMI VISIBLE NONE;SQMI SQMI VISIBLE NONE;NAME2 NAME2 VISIBLE NONE;Shape_Length Shape_Length VISIBLE NONE;Shape_Area Shape_Area VISIBLE NONE")

#Process: Select Layer By Attributes
countySelection = arcpy.SelectLayerByAttribute_management(county_Layer, "NEW_SELECTION", "\"NAME\" = '%countyName%' ")
# Process: Select Layer By Location
results = arcpy.SelectLayerByLocation_management(countySelection, "INTERSECT", "", "", "NEW_SELECTION")

# Process: Copy Features
#arcpy.CopyFeatures_management(county_Layer, Output_Feature_Class, "", "0", "0", "0")
## Step through the selection to get the values from the name field

rows = arcpy.SearchCursor(results,"","","NAME","NAME")
for row in rows:
&amp;nbsp; neighborVal = row.getValue("NAME")
&amp;nbsp; countyList.append(neighborVal)
&amp;nbsp; txt_list = ','.join(countyList)
print txt_list&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;It feels very close!&amp;nbsp; I am happy to see those county names listed out in my shell window, even if they aren't yet working when I use a variable instead.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Dec 2021 20:01:45 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/can-i-return-a-list-of-attribute-values-from-a/m-p/95#M33</guid>
      <dc:creator>TracySchloss</dc:creator>
      <dc:date>2021-12-10T20:01:45Z</dc:date>
    </item>
    <item>
      <title>Re: Can I return a list of attribute values from a geoprocessing service?</title>
      <link>https://community.esri.com/t5/python-questions/can-i-return-a-list-of-attribute-values-from-a/m-p/96#M34</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I'm trying to return a string from a gp service.&amp;nbsp; I'm starting with a pyt below, but I don't see how to populate the output param1 here.&amp;nbsp; any ideas?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
import arcpy


class Toolbox(object):
&amp;nbsp;&amp;nbsp;&amp;nbsp; def __init__(self):
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; """Define the toolbox (the name of the toolbox is the name of the
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; .pyt file)."""
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; self.label = "ForestStats"
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; self.alias = ""

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; # List of tool classes associated with this toolbox
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; self.tools = [getSummary]


class getSummary(object):
&amp;nbsp;&amp;nbsp;&amp;nbsp; def __init__(self):
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; """Define the tool (tool name is the name of the class)."""
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; self.label = "GetData"
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; self.description = ""
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; self.canRunInBackground = False

&amp;nbsp;&amp;nbsp;&amp;nbsp; def getParameterInfo(self):
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; """Define parameter definitions"""

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; param0 = arcpy.Parameter(
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; displayName="Area of Interest",
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; name="in_area",
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; datatype="String",
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; parameterType="Required",
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; direction="Input")
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; param1 = arcpy.Parameter(
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; displayName="Forest Statistics",
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; name="forest_statistics",
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; datatype="String",
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; parameterType="Derived",
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; direction="Output")&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; params = [param0, param1]
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return params


&amp;nbsp;&amp;nbsp;&amp;nbsp; def isLicensed(self):
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; """Set whether tool is licensed to execute."""
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return True



&amp;nbsp;&amp;nbsp;&amp;nbsp; def execute(self, parameters, messages):
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; """The source code of the tool."""
 d = {}
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; tbl = r'E:\gis\forestry\20120711_forestryWebApp\Forestry.gdb\wholeCity'
 with arcpy.da.SearchCursor(tbl, ('rangeClass', 'count')) as c:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; for r in c:
&amp;nbsp; d[r[0]] = r[1]
 
 print d
 arcpy.AddMessage(str(d))
 
 #params[1] = str(d)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return 
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;It adds the message just fine...&amp;nbsp; How do i pass str(d) to the output param1?&amp;nbsp; Once I do this, I should have a gp service that returns some good clean data!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Dec 2021 20:01:48 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/can-i-return-a-list-of-attribute-values-from-a/m-p/96#M34</guid>
      <dc:creator>KevinBell</dc:creator>
      <dc:date>2021-12-10T20:01:48Z</dc:date>
    </item>
    <item>
      <title>Re: Can I return a list of attribute values from a geoprocessing service?</title>
      <link>https://community.esri.com/t5/python-questions/can-i-return-a-list-of-attribute-values-from-a/m-p/97#M35</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt; I did realize somewhere along the way that I couldn't use a featureclass as input.&amp;nbsp;&amp;nbsp; &lt;BR /&gt; &lt;BR /&gt;I'm getting confused on whether I should run this from the python shell or if I can run it as a script in a toolbox. If I run it as a script, it gives me the prompt I expect for the name, but it doesn't seem to return anything. There aren't any errors, either. I'm not sure there's even a place for my results to go since it's just returning a list and not anything like a layer or table.&amp;nbsp; &lt;BR /&gt; &lt;BR /&gt;If I run it through the shell, then when do I specify my input string to search on?&amp;nbsp;&amp;nbsp; &lt;BR /&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Since this is something that may get called by another application (your developer's java app) I think you want this to run from the shell rather than as something that is interacted with through toolbox. In that scenario you need to be able to supply python with the input variable that is the county name. To get user input from a python script that you run from the shell use 'raw_input' - this is implemented like this:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN style="color:&amp;quot;#0000CD&amp;quot;;"&gt;input_county &lt;/SPAN&gt;&lt;SPAN&gt;= raw_input('What County do you want to select?')&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;that will prompt the user for a value and then that value (stored in the input_county variable) can be passed into the selection query in your Select by Attributes process:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;selection = arcpy.SelectLayerByAttribute_management(Output_Layer, "NEW_SELECTION", "\"NAME\" = &lt;/SPAN&gt;&lt;SPAN style="color:&amp;quot;#0000CD&amp;quot;;"&gt;input_county&lt;/SPAN&gt;&lt;SPAN&gt;")&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;You and your java developer might take a look at this blog post to see how you get something out of a python script:&lt;/SPAN&gt;&lt;BR /&gt;&lt;A href="http://norwied.wordpress.com/2012/03/28/call-python-script-from-java-app/" rel="nofollow"&gt;http://norwied.wordpress.com/2012/03/28/call-python-script-from-java-app/&lt;/A&gt;&lt;BR /&gt;&lt;SPAN&gt;The other piece of the puzzle that I don't know just yet is how you get the county name INTO python.. I don't know if thats something that needs to get passed in from Java (say the app has a form that a person selects a county name from a drop down...), or if you implement the raw_input method if that will work as it does when you run python from the shell.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 20 Jul 2012 10:57:20 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/can-i-return-a-list-of-attribute-values-from-a/m-p/97#M35</guid>
      <dc:creator>ChristopherThompson</dc:creator>
      <dc:date>2012-07-20T10:57:20Z</dc:date>
    </item>
    <item>
      <title>Re: Can I return a list of attribute values from a geoprocessing service?</title>
      <link>https://community.esri.com/t5/python-questions/can-i-return-a-list-of-attribute-values-from-a/m-p/98#M36</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;I'm trying to return a string from a gp service....How do i pass str(d) to the output param1?&amp;nbsp; Once I do this, I should have a gp service that returns some good clean data!&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Kevin, nice hijack of someone else's thread &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I'd suggest posting your question in its own thread as it will probably get more attention that way and there are a number of issues here that aren't related to the current one - script tools, the setting of parameters for a script tool and the use of dictionaries.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 20 Jul 2012 12:04:14 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/can-i-return-a-list-of-attribute-values-from-a/m-p/98#M36</guid>
      <dc:creator>ChristopherThompson</dc:creator>
      <dc:date>2012-07-20T12:04:14Z</dc:date>
    </item>
    <item>
      <title>Re: Can I return a list of attribute values from a geoprocessing service?</title>
      <link>https://community.esri.com/t5/python-questions/can-i-return-a-list-of-attribute-values-from-a/m-p/99#M37</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;The input worked fine in that I got a prompt.&amp;nbsp; Since I'd been using countyName as my varable I just set it as &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_macro_code jive_text_macro"&gt;countyName = raw_input('What County do you want to select?')&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;When I tried your expression as-is,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_macro_code jive_text_macro"&gt;countySelection = arcpy.SelectLayerByAttribute_management(county_Layer, "NEW_SELECTION", "\"NAME\" = countyName")&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt; it told me I had a syntax error:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Traceback (most recent call last):&lt;BR /&gt;&amp;nbsp; File "C:\ESRItest\model\adjacent.py", line 36, in &amp;lt;module&amp;gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; countySelection = arcpy.SelectLayerByAttribute_management(county_Layer, "NEW_SELECTION", "\"NAME\" = countyName")&lt;BR /&gt;&amp;nbsp; File "C:\Program Files\ArcGIS\Desktop10.0\ArcPy\arcpy\management.py", line 4259, in SelectLayerByAttribute&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; raise e&lt;BR /&gt;ExecuteError: ERROR 000358: Invalid expression&lt;BR /&gt;Failed to execute (SelectLayerByAttribute).&lt;/BLOCKQUOTE&gt;&lt;SPAN&gt;I figured it wanted some quotes, so I changed it to &lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_macro_code jive_text_macro"&gt;countySelection = arcpy.SelectLayerByAttribute_management(county_Layer, "NEW_SELECTION", "\"NAME\" = 'countyName'")&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;This didn't error, but it didn't return anything either!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks for the suggestion of another thread for a question that is only vaguely related to mine!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 20 Jul 2012 15:47:59 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/can-i-return-a-list-of-attribute-values-from-a/m-p/99#M37</guid>
      <dc:creator>TracySchloss</dc:creator>
      <dc:date>2012-07-20T15:47:59Z</dc:date>
    </item>
    <item>
      <title>Re: Can I return a list of attribute values from a geoprocessing service?</title>
      <link>https://community.esri.com/t5/python-questions/can-i-return-a-list-of-attribute-values-from-a/m-p/100#M38</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;This one works.&amp;nbsp; I spent an hour trying to figure out how to manage the quotes properly in my expression!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;# --------------------------------------------------------------------------- # adjacent.py # Created on: 2012-07-12 15:14:17.00000 #&amp;nbsp;&amp;nbsp; (generated by ArcGIS/ModelBuilder) # Usage: adjacent &amp;lt;countyName&amp;gt;&amp;nbsp; # Description:&amp;nbsp; # ---------------------------------------------------------------------------&amp;nbsp; # Import arcpy module import arcpy&amp;nbsp; # Set Geoprocessing environments arcpy.env.scratchWorkspace = "C:\\ESRItest\\model\\process.gdb" arcpy.env.workspace = "C:\\ESRItest\\model\\process.gdb"&amp;nbsp; #overwrite pre-existing files arcpy.env.overwriteOutput = True&amp;nbsp; # Script arguments #countyName = arcpy.GetParameterAsText(0) countyName = raw_input('What County do you want to select?')&amp;nbsp; # Local variables: county = "county" county_Layer = "county_Layer" countyList = [] txt_list = ""&amp;nbsp; #Output_Feature_Class = "C:\\ESRItest\\model\\process.gdb\\county_CopyFeaturesOutput"&amp;nbsp; # Process: Make Feature Layer county_Layer = arcpy.MakeFeatureLayer_management("C:\ESRItest\model\process.gdb\county", county_Layer, "", "", "OBJECTID OBJECTID VISIBLE NONE;Shape Shape VISIBLE NONE;NAME NAME VISIBLE NONE;CNTY_FIPS CNTY_FIPS VISIBLE NONE;FIPS FIPS VISIBLE NONE;POP2005 POP2005 VISIBLE NONE;POP05_SQMI POP05_SQMI VISIBLE NONE;SQMI SQMI VISIBLE NONE;NAME2 NAME2 VISIBLE NONE;Shape_Length Shape_Length VISIBLE NONE;Shape_Area Shape_Area VISIBLE NONE")&amp;nbsp; #Process: Select Layer By Attributes&amp;nbsp; #print countyName&amp;nbsp; whereClause=" \"NAME\" = " + "'"+countyName+"'" #print whereClause countySelection = arcpy.SelectLayerByAttribute_management(county_Layer, "NEW_SELECTION", whereClause)&amp;nbsp; # Process: Select Layer By Location results = arcpy.SelectLayerByLocation_management(countySelection, "BOUNDARY_TOUCHES", "", "", "NEW_SELECTION")&amp;nbsp; # Process: Copy Features #arcpy.CopyFeatures_management(county_Layer, Output_Feature_Class, "", "0", "0", "0") ## Step through the selection to get the values from the name field&amp;nbsp; rows = arcpy.SearchCursor(results,"","","NAME","NAME") for row in rows: &amp;nbsp; neighborVal = row.getValue("NAME") &amp;nbsp; if neighborVal != countyName: &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; countyList.append(neighborVal) &amp;nbsp; txt_list = ','.join(countyList) print txt_list&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I still need to figure out how in the world to manage this as a call from Java.&amp;nbsp; At least I can give input and receive output from within the Python window.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks so much Chris for your assistance!!!!!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 20 Jul 2012 18:17:39 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/can-i-return-a-list-of-attribute-values-from-a/m-p/100#M38</guid>
      <dc:creator>TracySchloss</dc:creator>
      <dc:date>2012-07-20T18:17:39Z</dc:date>
    </item>
    <item>
      <title>Re: Can I return a list of attribute values from a geoprocessing service?</title>
      <link>https://community.esri.com/t5/python-questions/can-i-return-a-list-of-attribute-values-from-a/m-p/101#M39</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Tracy good luck!&amp;nbsp; I would be interested to see how you work out the implementation of this in the Java app - if you would post your solution that would be very cool.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;ct&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 24 Jul 2012 12:28:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/can-i-return-a-list-of-attribute-values-from-a/m-p/101#M39</guid>
      <dc:creator>ChristopherThompson</dc:creator>
      <dc:date>2012-07-24T12:28:06Z</dc:date>
    </item>
  </channel>
</rss>

