<?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: Enhanced Search Widget - Loading userlist from attributtable? in ArcGIS Viewer for Flex Questions</title>
    <link>https://community.esri.com/t5/arcgis-viewer-for-flex-questions/enhanced-search-widget-loading-userlist-from/m-p/466408#M13199</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi Yvonne and Robert,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I hope you don't mind me interjecting but creating lengthy userlists is something that I have had to do on many occasions, the workflow I use to create the list is as follows:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;1. Export the attribute table to a .dbf file.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;2. Open the .dbf in excel, highlight the column I want to create the userlist for and then use the remove duplicates tool under the data ribbon to give me a list of unique values. Optionally sort A-z so the the list is presented alphabetically.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;3. Copy the column and open up word. Paste the column using paste special, unformatted text (otherwise it will paste in as a table).&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;4. Do a find and replace using ^p (newline in word) with , (comma). You should then have a list of comma separated values.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Hope this helps&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Regards&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Anthony&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 18 Sep 2012 15:48:30 GMT</pubDate>
    <dc:creator>AnthonyGiles</dc:creator>
    <dc:date>2012-09-18T15:48:30Z</dc:date>
    <item>
      <title>Enhanced Search Widget - Loading userlist from attributtable?</title>
      <link>https://community.esri.com/t5/arcgis-viewer-for-flex-questions/enhanced-search-widget-loading-userlist-from/m-p/466406#M13197</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi, &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I have a very long userlist (&amp;gt;50 entries), but it´s necessary.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Is ist possible to load the attributes from the attribute table instead of writing the list?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;my code:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;[HTML]&amp;lt;expression alias="Flurstück" textsearchlabel="Flurstückssuche" isvaluerequired="false"&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;values&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;value prompt="Gemarkung" userlist="Günne,Meschede-Stadt,etc" isvaluerequired="false"&amp;gt;upper(locationhierarchy_text) = upper('[value]')&amp;lt;/value&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;value prompt="Flur z.B.: 6" isvaluerequired="false"&amp;gt;upper(subdivisionnumber) = upper('[value]')&amp;lt;/value&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;value prompt="Flurstück z.B.: 273" isvaluerequired="false"&amp;gt;upper(parceloflandnumber) = upper('[value]')&amp;lt;/value&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;/values&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;/expression&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;[/HTML]&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I tested something like: userlist="(locationhierarchy_text)"&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 18 Sep 2012 12:40:58 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-viewer-for-flex-questions/enhanced-search-widget-loading-userlist-from/m-p/466406#M13197</guid>
      <dc:creator>YvonneDeus</dc:creator>
      <dc:date>2012-09-18T12:40:58Z</dc:date>
    </item>
    <item>
      <title>Re: Enhanced Search Widget - Loading userlist from attributtable?</title>
      <link>https://community.esri.com/t5/arcgis-viewer-for-flex-questions/enhanced-search-widget-loading-userlist-from/m-p/466407#M13198</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Yvonne,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp; No that is not possible as that would be a very close duplication of the domain ability that the eSearch already has. So the two options available are to manually type a userlist or to use a coded value domain for your geodatabase of the list.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 18 Sep 2012 13:14:20 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-viewer-for-flex-questions/enhanced-search-widget-loading-userlist-from/m-p/466407#M13198</guid>
      <dc:creator>RobertScheitlin__GISP</dc:creator>
      <dc:date>2012-09-18T13:14:20Z</dc:date>
    </item>
    <item>
      <title>Re: Enhanced Search Widget - Loading userlist from attributtable?</title>
      <link>https://community.esri.com/t5/arcgis-viewer-for-flex-questions/enhanced-search-widget-loading-userlist-from/m-p/466408#M13199</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi Yvonne and Robert,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I hope you don't mind me interjecting but creating lengthy userlists is something that I have had to do on many occasions, the workflow I use to create the list is as follows:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;1. Export the attribute table to a .dbf file.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;2. Open the .dbf in excel, highlight the column I want to create the userlist for and then use the remove duplicates tool under the data ribbon to give me a list of unique values. Optionally sort A-z so the the list is presented alphabetically.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;3. Copy the column and open up word. Paste the column using paste special, unformatted text (otherwise it will paste in as a table).&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;4. Do a find and replace using ^p (newline in word) with , (comma). You should then have a list of comma separated values.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Hope this helps&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Regards&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Anthony&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 18 Sep 2012 15:48:30 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-viewer-for-flex-questions/enhanced-search-widget-loading-userlist-from/m-p/466408#M13199</guid>
      <dc:creator>AnthonyGiles</dc:creator>
      <dc:date>2012-09-18T15:48:30Z</dc:date>
    </item>
    <item>
      <title>Re: Enhanced Search Widget - Loading userlist from attributtable?</title>
      <link>https://community.esri.com/t5/arcgis-viewer-for-flex-questions/enhanced-search-widget-loading-userlist-from/m-p/466409#M13200</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;OK! Thanks you both. &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;So I don´t needed to waste time for searching a html code ;-). I´ll try your copy &amp;amp; paste variance and then I have to rember if my attribute table will be changed.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Sep 2012 09:45:19 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-viewer-for-flex-questions/enhanced-search-widget-loading-userlist-from/m-p/466409#M13200</guid>
      <dc:creator>YvonneDeus</dc:creator>
      <dc:date>2012-09-19T09:45:19Z</dc:date>
    </item>
    <item>
      <title>Re: Enhanced Search Widget - Loading userlist from attributtable?</title>
      <link>https://community.esri.com/t5/arcgis-viewer-for-flex-questions/enhanced-search-widget-loading-userlist-from/m-p/466410#M13201</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Yvonne,&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Be sure to mark Anthony's post as the answer.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;Click the Mark as answer check&lt;/STRONG&gt;&lt;SPAN&gt; on this post and to &lt;/SPAN&gt;&lt;STRONG&gt;click the top arrow (promote)&lt;/STRONG&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;BR /&gt;&lt;STRONG&gt;Follow the steps&lt;/STRONG&gt;&lt;SPAN&gt; as shown in the below graphic on his post:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;IMG src="http://gis.calhouncounty.org/FlexViewer3.0/Answer.jpg" /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Sep 2012 11:58:44 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-viewer-for-flex-questions/enhanced-search-widget-loading-userlist-from/m-p/466410#M13201</guid>
      <dc:creator>RobertScheitlin__GISP</dc:creator>
      <dc:date>2012-09-19T11:58:44Z</dc:date>
    </item>
    <item>
      <title>Re: Enhanced Search Widget - Loading userlist from attributtable?</title>
      <link>https://community.esri.com/t5/arcgis-viewer-for-flex-questions/enhanced-search-widget-loading-userlist-from/m-p/466411#M13202</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;All,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have had this need myself, normally due to a dynamic "userlist" that could possibly change from day to day as data is added.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;My "solution" was to make a python script that gets the unique values from my data, makes a replacement string, searches the eSearchWidget.xml for a particular string, and replaces that line with the newly created line.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Basically, in the eSearchWidget.xml I add something similar to &lt;/SPAN&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&amp;lt;!--replace1_start--&amp;gt;&amp;lt;value userlist="value1, value2, all"&amp;gt;summary_Milestone_Date = '[value]'&amp;lt;/value&amp;gt;&lt;/PRE&gt;&lt;SPAN&gt;.&amp;nbsp; then my script will look for the respective "replace1, replace2" section so it knows what line to "replace".&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Here is the snippet if anyone is interested, I have configured it as a def so at the bottom, you can make the list of fields/search text and it will run through them all.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;# Import arcpy module
import arcpy,shutil,fileinput,io



# Local variables:
summary = "\\\\mcflight01\\MCFlightData\\HGIS\\Data\\data_4_temp_services.gdb\\summary"&amp;nbsp; # my dataset I'm searching against
temp_path = "D:\\baks\\dont_use\\temp.gdb\\"
config_file = "\\\\gis01\\C\\inetpub\\wwwroot\\WCH_WIDS_Status\\widgets\\eSearch\\eSearchWidget.xml"
ifile = "D:\\baks\\dont_use\\eSearchWidget_template.xml"
ofile = "D:\\baks\\dont_use\\eSearchWidget.xml"

# Overwrite pre-existing files

arcpy.env.overwriteOutput = True

# copy config file to a working copy

shutil.copy2(config_file, ifile)


def UniqueList():
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; DataList = []
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; NewString = ''
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; temp_freq = temp_path + fieldName + "_freq"
#
# Process: Frequency to get unique list by fieldName
#
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.Frequency_analysis(summary, temp_freq, fieldName, "")
 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; for row in arcpy.SearchCursor(temp_freq, "", "", fieldName):
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; DataList.append(row.getValue(fieldName))
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; NewString += str(row.getValue(fieldName)) + ","
#
# Set value for replacement string
#
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; repStr =&amp;nbsp; 43*" " + '&amp;lt;value userlist="' + NewString + """all"&amp;gt;summary_""" + fieldName + " = '[value]\'&amp;lt;/value&amp;gt;""" + "\n"

#
# Open file to read values
#
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; with open(ifile,"r") as infile:

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; with open(ofile,"w") as outfile:&amp;nbsp;&amp;nbsp; # open file to be able to write to
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; for i, line in enumerate(infile):

&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; if searchText in line:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; # Check to see if the searchtext is in this line
&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; line = repStr
&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; outfile.write(line)&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; #&amp;nbsp; If so, replace this line with the string value of repStr.
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; outfile.close&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;&amp;nbsp;&amp;nbsp;&amp;nbsp; #close outfile
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; infile.close&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; #close infile
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; shutil.copy2(ofile, ifile)&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; #copy the outfile to the new infile so it doesn't clobber last changes

#
#&amp;nbsp; List of field names and respective replace text.
#&amp;nbsp; Just add another fieldName/searchText pair and send to UniqueList()
#
# userlist for Milestone_Date
fieldName = "Milestone_Date"
print "processing ",fieldName
searchText = "replace1"
UniqueList()

# userlist for FINAL_ROD_DEC_UNIT
fieldName = "FINAL_ROD_DEC_UNIT"
print "processing ",fieldName
searchText = "replace2"
UniqueList()

# userlist for Note
fieldName = "Note"
print "processing ",fieldName
searchText = "replace3"
UniqueList()

# userlist for Date
fieldName = "Date"
print "processing ",fieldName
searchText = "replace4"
UniqueList()

print "Done"
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Of course, this example writes to a copy of the eSearchWidget.xml.&amp;nbsp; just need to modify the path to actually have it make the update.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;This script then runs every night to incorporate the days changes.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Hope this helps someone,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;R_&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 20:41:10 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-viewer-for-flex-questions/enhanced-search-widget-loading-userlist-from/m-p/466411#M13202</guid>
      <dc:creator>RhettZufelt</dc:creator>
      <dc:date>2021-12-11T20:41:10Z</dc:date>
    </item>
    <item>
      <title>Re: Enhanced Search Widget - Loading userlist from attributtable?</title>
      <link>https://community.esri.com/t5/arcgis-viewer-for-flex-questions/enhanced-search-widget-loading-userlist-from/m-p/466412#M13203</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Won't let me edit the post, so here is "fix" to code:&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; repStr =&amp;nbsp; 35*" " + "&amp;lt;!--" + searchText + "--&amp;gt;" + '&amp;lt;value userlist="' + NewString + """all"&amp;gt;summary_""" + fieldName + " = '[value]\'&amp;lt;/value&amp;gt;""" + "\n"
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;otherwise, it doesn't know where/what to replace after first run.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;R_&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 20:41:13 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-viewer-for-flex-questions/enhanced-search-widget-loading-userlist-from/m-p/466412#M13203</guid>
      <dc:creator>RhettZufelt</dc:creator>
      <dc:date>2021-12-11T20:41:13Z</dc:date>
    </item>
  </channel>
</rss>

