AnsweredAssumed Answered

JS API - potential issue with feature layer and null values in data

Question asked by tim.wood on Nov 12, 2015

I've downloaded the feature layer hover sample (uses API 3.14) and switched it to use our data.

https://developers.arcgis.com/javascript/jssamples/fl_hover.html

The data is being served from ArcGIS Server 10.3.1 running on Windows Server and the data is in ArcSDE 9.3.

 

The data is drains and I want to symbolise it by category using owner and defect status fields.  When using unique values from just the owner field it works fine.  However when I switched from using one field to two fields not all records display when using a feature layer in my viewer.  My testing suggests this is because one of the possible values from the status fields is null.  The possible combination of values are shown in the attached doc.

 

If I display the layer using an ArcGIS Dynamic Map Service layer all features display (but the hover functionality requires use of the Feature Layer).  However when I switch to a Feature Layer, any records with null as their Status value do not display and are not highlighted when I hover over them.  It does not make a difference whether the field that has null values is used in the info popup.

 

I have come up with 2 workarounds for this:

1) Replace all null values with something else (e.g. "OK" in this example).

2) Use the "All other values" option in the layer properties.

Depending on the circumstances one or both of these workarounds may not be practical.

In this example we are aiming to have the defect status in a table which is joined to the drain layer (possibly in a view).  Ideally the defect table would only contain records for drains with open or recently fixed problems, not all drains (there are 160,000!).  I can modify the Status field value in the view so that for records with null is returns a Status of "OK" but this will add an overhead.

Outcomes