Select to view content in your preferred language

Simple Search (Widget)

1543
4
Jump to solution
04-23-2013 05:05 AM
BarryHill1
Deactivated User
Can someone please help me on the code for a simple search...I wish users to be able to search a layer item and need the code that will return the value. But I need the code that returns when the request is NOT Case Sensitive or name is partially selected. For example: Selecting a text item = 'Name' , but will return the value if the user inputs 'name' or 'Nam'.

I am still using Flex 2.4 on ArcGIS for Server 10.0



<?xml version="1.0" ?>
<configuration>
    <layers>
        <layer>
            <name>Lease Parcels</name>
            <url>http://portgis/Arcgis10/rest/services/FlexTest/MapServer/1</url>
            <expression>Tenant like '[value]'</expression>
<textsearchlabel>Search by Tenant Name [ Example: Martin Marietta or Mart%]</textsearchlabel>
            <titlefield>Tenant</titlefield>
            <linkfield>PDF Hyperlink</linkfield>
            <fields all="true"/>
        </layer>
    </layers>
    <zoomscale>10000</zoomscale>
</configuration>


What am I missing? Thank you.
Tags (2)
0 Kudos
1 Solution

Accepted Solutions
RobertScheitlin__GISP
MVP Emeritus
Barry,

   BTW you missed step 1 of the below graphic:

Don't forget to click the Mark as answer check on this post and to click the top arrow (promote).
Follow these steps as shown in the below graphic:

View solution in original post

0 Kudos
4 Replies
RobertScheitlin__GISP
MVP Emeritus
Barry,

   It is basic SQL syntax you are missing:

<expression>Upper(Tenant) LIKE Upper('[value]%')</expression>


Don't forget to click the Mark as answer check on this post and to click the top arrow (promote).
Follow these steps as shown in the below graphic:

0 Kudos
BarryHill1
Deactivated User
Robert,

In my sql strings, should I have the code for Tenant in quotes?

<expression>Upper("Tenant") LIKE Upper('[value]%')</expression>

No matter what I do I'm getting an error message:

[RPC Fault faultString="Unable to complete opration."
faultCode="400" faultDetail="Unable to complete Query operation."]
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Barry,

   Tenant should not be in quotes. Double check the CaSe of the field name and ALL the field names you are sending in the Query as you will get that error if you are sending a field the does not exist as one of the outfields for the query.
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Barry,

   BTW you missed step 1 of the below graphic:

Don't forget to click the Mark as answer check on this post and to click the top arrow (promote).
Follow these steps as shown in the below graphic:

0 Kudos