Select to view content in your preferred language

Sort StoryMap Crowdsource Data Alphbetically

597
3
Jump to solution
06-12-2018 07:41 AM
JaredPilbeam2
MVP Regular Contributor

In this webapp the input data displays in order that a user adds it. Is there a way to alphabetize it? I heard you can do this with the unique ID, but I'm struggling to see how.

Here's how the data is displayed as of now:

0 Kudos
1 Solution

Accepted Solutions
StephenSylvia
Esri Regular Contributor

You can download the source code from github: GitHub - Esri/storymap-crowdsource: The Story Map Crowdsource℠ app enables you to publish and manage... 

Make you're using the full developer version because you will need to modify the the original source code and rebuild the app for production. More info here: https://developerscorner.storymaps.arcgis.com/an-introduction-to-hosting-your-own-story-map-e2450181... 

After downloading the app, you will also need to fork this repo: GitHub - ssylvia/cluster-layer-js: One way to cluster many, many point features. This is a custom cluster layer used to render the points in the map. It contains all the logic for the query.

After this line: cluster-layer-js/clusterfeaturelayer.js at master · ssylvia/cluster-layer-js · GitHub , you should be able to add something like this:

this._query.orderByFields = ["Name DESC"];

Now, replace the current cluster layer used in the app with your fork:

storymap-crowdsource/bower.json at master · Esri/storymap-crowdsource · GitHub   

Finally, you can rebuild the app and host it on your own server.

View solution in original post

3 Replies
StephenSylvia
Esri Regular Contributor

This cannot be done on the hosted version of the crowdsource application. The features service query sorts the features by creation date. The only way to change this would be to download the source code and modify the query to the feature service.

0 Kudos
JaredPilbeam2
MVP Regular Contributor

Stephen,

Thanks for the reply. Where would I download the source code from?

0 Kudos
StephenSylvia
Esri Regular Contributor

You can download the source code from github: GitHub - Esri/storymap-crowdsource: The Story Map Crowdsource℠ app enables you to publish and manage... 

Make you're using the full developer version because you will need to modify the the original source code and rebuild the app for production. More info here: https://developerscorner.storymaps.arcgis.com/an-introduction-to-hosting-your-own-story-map-e2450181... 

After downloading the app, you will also need to fork this repo: GitHub - ssylvia/cluster-layer-js: One way to cluster many, many point features. This is a custom cluster layer used to render the points in the map. It contains all the logic for the query.

After this line: cluster-layer-js/clusterfeaturelayer.js at master · ssylvia/cluster-layer-js · GitHub , you should be able to add something like this:

this._query.orderByFields = ["Name DESC"];

Now, replace the current cluster layer used in the app with your fork:

storymap-crowdsource/bower.json at master · Esri/storymap-crowdsource · GitHub   

Finally, you can rebuild the app and host it on your own server.