Dashboard data expression not showing when map filtering is enabled

483
0
06-20-2022 03:37 PM
SkiNail
New Contributor II

The issue: I have a bunch of data expressions in a dashboard. The indicator widget is used to display the result from the data expression. However, when I enable Map Actions to filter based on the map frame extent, the indicators stop returning a result and say "no data".

The data expressions: I have 3. Each one is different but they all have the same basic principle. There are a bunch of similar layers in the map, and the data expressions sum a field in each layer, or count the features in each layer and returns the result. Here is an example of one of them. 

// Number of events
var portal = Portal('https://www.arcgis.com/');

// S003_zone
var S003_zone = FeatureSetByPortalItem(portal,'2a719b3952dc4d399e5d8ec4905236df',8,['OBJECTID'],true);
var S003_Count = COUNT(S003_zone);

// S004_zone
var S004_zone = FeatureSetByPortalItem(portal,'2a719b3952dc4d399e5d8ec4905236df',7,['OBJECTID'],true);
var S004_Count = COUNT(S004_zone);

// S005_zone
var S005_zone = FeatureSetByPortalItem(portal,'2a719b3952dc4d399e5d8ec4905236df',6,['OBJECTID'],true);
var S005_Count = COUNT(S005_zone);

// S006_zone
var S006_zone = FeatureSetByPortalItem(portal,'2a719b3952dc4d399e5d8ec4905236df',5,['OBJECTID'],true);
var S006_Count = COUNT(S006_zone);

// Total number of spray events
var Number_of_events = S003_Count + S004_Count + S005_Count + S006_Count

// create data schema
var Dict = {
    'fields': [
        {'name': 'Number_of_events', 'type': 'esriFieldTypeInteger'}],
    'geometryType': '',   
    'features': []};
    
// fill the data schema with the data
Dict.features[0] = {
            'attributes': {
                'Number_of_events': Number_of_events
            }}

// return the featureset
return FeatureSet(Text(Dict));

As you can see, it is by portal ID. I have also tried Group By with the same result. 

I'd really appreciate some guidance on this. I understand that filtering by map extent might impact performance. I'll cross that bridge when I get to it!

0 Replies