Unique Value Error - Esearch

3078
13
Jump to solution
10-26-2015 01:39 PM
MelissaMeneghetti
New Contributor III

Hi Robert,

I am not sure if this may be a bug in the widget but when I try and access the unique values for a data layer that has many unique values present (i.e. over 100), in the 'Add Expression' dialogue the window just seems to spin on the 'Retrieving unique values' (see attached print screen). Have you encountered any other problems with this or is the number of unique values present a problem? Thanks

ConsoleCapture.JPG

SearchCapture.JPG

0 Kudos
1 Solution

Accepted Solutions
RobertScheitlin__GISP
MVP Emeritus

Melissa,

   It is actually a one line fix in the code. If you open your apps [install dir]\\server\apps\[app #]\widgets\eSearch\PaginingQueryTask.js file and find these lines:

        if (this.version >= 10.1) {

          this.query.orderByFields = [this.fieldName];

        }

And change it to:

        if (this.version > 10.11) {

          this.query.orderByFields = [this.fieldName];

        }

You will be in business

View solution in original post

13 Replies
RobertScheitlin__GISP
MVP Emeritus

Melissa,

   Could you post again with the developer tools on the console tab (instead of the network tab)?

0 Kudos
MelissaMeneghetti
New Contributor III

Ok just reposted with a different screen shot:)

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

OK,
that helps. Can you attach your config_Enhanced Search.json file?

0 Kudos
MelissaMeneghetti
New Contributor III

Ok done..but for some reason, when I access the config.json under the server apps (i.e. C:\WAB\arcgis-web-appbuilder-1.2\arcgis-web-appbuilder-1.2\server\apps\2\widgets\eSearch), the config file seems to show only the layers that were downloaded with the esearch zip file...it doesn't seem to be updated with my data layers?

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

Melissa,

   That is because that file is not the one that is updated and used by the widget you will find the one that I need is located here: C:\WAB\arcgis-web-appbuilder-1.2\arcgis-web-appbuilder-1.2\server\apps\2\configs\eSearch\config_Enhanced Search.json

MelissaMeneghetti
New Contributor III

Thanks Robert that makes better sense...I have attached the file!

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

Melissa,

   Have updated my help documentation to help people understand that using "definitionexpression": "1=1", is not necessary and will cause issues. Remove 1=1 from the definition expression field in the widgets UI for all your layers.

Web AppBuilder for ArcGIS | Help - Enhanced Search widget | Definition Expression

0 Kudos
MelissaMeneghetti
New Contributor III

Ok I removed it (see attached) but it still spins with the 'Retrieving Unique Values'.

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

Melissa,

   This is the query that is being sent to your service and it is failing.

http://www.mapservices.ca:6080/arcgis/rest/services/Fairwinds/Base_Data/MapServer/3/query?where=1%3D...

So I did some testing using a small integer field with one of my map services and it work fine with almost identical query parameters.

I am concerned about the use of "Unique" as a field name in your data (as that would seem to be a reserved keyword in many databases). I would suggest a test by renaming or recreating the field in your data with a underscore (i.e. _unique) or some other more meaningful name and re-testing.

0 Kudos