Arcade in webmap - getting the legend correct

270
3
01-10-2020 04:39 AM
leonoestergaard
New Contributor III

My webmap is using a service - the service returns upto 2000 records at a time. Lets say the first 2000 records looks like this

Id

ObjectIdValueToUseShape
13
28
3null
4null
2000null

The first two rows has Value in ValueTo use the remaining 1998 has null as value to use - its fine I will still display the feature.

The next 2000 rows from the service looks like this

ObjectIdValueToUseShape
200132
200211
200324
20043
40008

The ValueToUse from the second call (objectid 2001-4000) will all be displayed as "other"

The example is only to simplify the issue. In the real world my Arcade script is depending on the "ValueToUse"

Tags (1)
3 Replies
XanderBakker
Esri Esteemed Contributor

Hi leon oestergaard ,

So your service contains more than 2000 features and it requieres multiple requests to get a full list of all the values in your field, right? How many unique values do you have? How many features do you have in your service? Where is the data stored (hosted feature layer) or is the data coming from a different source?

When you apply the Arcade expression, not all values appear I assume? You could "hack" the json of the web map using AGOL Assistant to include missing values, but that might not be the optimal solution.

leonoestergaard
New Contributor III

Hi Xander Bakker

Yes much more than 2000 features. At this time theres 99 unique types. I would use arcade to group them.

I have now hacked the json, and it seems to work. However i dont know what the downside is to manipulated the json manually.

0 Kudos
XanderBakker
Esri Esteemed Contributor

Hi leon oestergaard ,

Hacking the comes with the risk that you could make the json invalid and the web map unusable. As far as I understand that did not happen (very good!). The downside is that when you enter symbology again, it will overwrite and regenerate the symbology and that is not what you want. However, when your data changes you will need to make the changes manually (using the json hack probably). So not a very recommended or user friendly procedure. Not sure is this works or will work differently in the new beta map viewer. Have you tried?

0 Kudos