Select to view content in your preferred language

Sorting ID Results 4.x

1662
8
Jump to solution
02-22-2018 06:16 AM
JeffSauder
Regular Contributor

Hi all,

I am looking for a way to sort the identify results using an identifytask and identifyparameters.  What is needed is to show ID results sorted by certain fields (for example, date descending so the users sees the newest feature first).  I tried sorting the tables in the ArcMap project, which seem to persist, but do not carry over to the ArcGIS Server published REST service.  I have also gone through the identify parameters and ID task trying to find if there is any way to set a sort field.  I do not use any sort of widget or popup for these results, I create my own ID display window by breaking down the JSON of the results.  I could sort these after the fact, which is what I might have to do, but before I go through all that, I just thought I'd check to see if there's something simple that I'm overlooking that would sort the results when the identify is performed.

Thanks in advance for any solutions / suggestions.

Jeff

0 Kudos
1 Solution

Accepted Solutions
RobertBorchert
Honored Contributor

After that I am burnt up on ideas.  Best of luck

View solution in original post

0 Kudos
8 Replies
RobertBorchert
Honored Contributor

Click on the Display tab for the feature in question.

In the Display Expression area click the Expression button and build an expression.

This is an example of an expression I built for my service meter locations

[BillingFileComplete.ServiceAddress] & " : "&  [ServicePoint.Detail] & " :" & [BillingFileComplete.Name]   &  " : "& [BillingFileComplete.EquipMapLocation]

It will sort results by Service Address, then Name.  pretty much whatever you want

JeffSauder
Regular Contributor

Hi Robert,

Thank you for the reply, much appreciated. I had already tried that, I notice that it does not sort. I wouldn’t doubt if I’m doing something wrong here.

I have links to the examples below. This is using ArcMap 10.3.1

This is where I went to set this in ArcMap. Just to verify that’s where you had mentioned setting this:

https://community.esri.com/docs/DOC-11451-sort1jpg

The expression I set was “[GBAGIS.dbo.tog_DevAgr_From_Eden.EffectiveDate] & " - " & ”

This is the result from the expression using the date and AgreementID in the expression (this is in ArcMap, I didn’t publish this to AGS), they don’t show in any logical order. I even tried ordering the attribute table for that feature class.

https://community.esri.com/docs/DOC-11452-sort2jpg

These are the results list from the interactive map (js): This is using the Agreement ID as display field, which is in the published service, no logical sorting here either.

https://community.esri.com/docs/DOC-11453-sort3jpg

If possible it would also be great to be able to say asc / desc somehow, the requests are mostly to sort by date descending, for some feature classes the user will drag a box to ID an area and return hundreds of features in some cases, and ordering by date is most helpful to them. I also have a tool that will put all ID results in an html table, so having that ordered is also helpful.

Also, if I put these files in the wrong location I apologize. If I need to move/remove them please let me know. I haven’t used GEONet much…

0 Kudos
RobertBorchert
Honored Contributor

Right click on the feature class in the identify window and make sure you have sort by ascending selected

0 Kudos
JeffSauder
Regular Contributor

Thanks Robert. I never knew that was there. That corrects the problem in arcmap.

Im guessing that doesn’t publish with the service? I republished it, It still doesn’t sort the ID results in the javascript map

0 Kudos
RobertBorchert
Honored Contributor

Go into your web map and set up the Pop up in a similar method.

0 Kudos
JeffSauder
Regular Contributor

I don’t use a pop up. Just consuming the raw id results, and creating my own table / display.

I’m guessing that if the popup is what is used to configure this, then I will have to write that functionality into my results processing since Im using my own.

I kind of figured that I’d have to do it that way, just was hoping maybe there was a sort option in the ID Parameters that I wasn’t seeing, that I could set before I sent the request to the server.

0 Kudos
RobertBorchert
Honored Contributor

After that I am burnt up on ideas.  Best of luck

0 Kudos
JeffSauder
Regular Contributor

Thank you Robert. I am going to be putting some public facing maps out using more of the widgets and popups than custom development like we are doing internally, so those suggestions will definitely help when I get to that. Thanks again.

Jeff