Select to view content in your preferred language

Serial Chart "Cannot Access Data" BUG-000120535 still not working

658
0
08-07-2023 12:53 PM
Labels (2)
DChavis
Emerging Contributor

I am using FeatureSetByPortalItem to call in three different layers, 2 points layers and one line layer; to make a serial chart of different types of assets on each park trail and their varying quality of condition. I am able to make the successful serial chart and it is able to interact with all of my other category selectors fine, except for when I try to make a category selector that filters by trail name. It then shows a small yellow triangle with exclamation point in the corner of the graph, and reads "cannot access data". 

I have tried making charts with the single layers individually using the same code, and the filter works fine on the individual layers but not when they are together. My suspicion is that the root of the problem is derived from the selector having to pull from and extrapolate from multiple attributes at the same time when asked this selection. For example it is having to see which assets with this specific trail name are of an asset type "A" and an asset quality "good"; whereas my other category selectors which are working fine on this serial chart only have to pull from the one attribute at a time. For example my other selector says to show only assets of this type "A" or only assets with this quality "good". 

I have tried changing the code to include either objectID or GlobalID and use these as the field indicator instead of the automated FID, this also did not solve the issue. 

 

This is the code: 

var p = Portal("https://arcgis.com");
var points = FeatureSetByPortalItem(p, "86d252f7fd6d4f63b05d17a4eecea414",0, ['Structure_Needed', 'Current_Condition','Location','OBJECTID_1'],false);
var lines =  FeatureSetByPortalItem(p, "7b9bb9011efa4a2ea4473987ce4c8c4f",0, ['Structure_Needed', 'Current_Condition','Location','OBJECTID'],false);
var quick =  FeatureSetByPortalItem(p, "ab6dfe7be9694f658fc9d8872fe74ef4",0, ['Structure', 'Condition','Trail_Name','OBJECTID_1'],false);



var features = [];
var feat;

for (var feature in points) {
  feat = {
    'attributes': {
      'Structure': feature['Structure_Needed'],
      'Condition': feature['Current_Condition'],
      'Trail Name': feature['Location'],
      'ObjectID': feature['OBJECTID_1'],
    }
  }
  Push(features,feat);
};


for (var feature in lines) {
  feat= {
    'attributes':{
      'Structure': feature['Structure_Needed'],
      'Condition': feature['Current_Condition'],
      'Trail Name': feature['Location'],
      'ObjectID': feature['OBJECTID'],
    }
  }
  Push(features, feat)
}

for (var feature in quick) {
  feat = {
    'attributes': {
      'Structure': feature['Structure'],
      'Condition': feature ['Condition'],
      'Trail Name': feature['Trail_Name'],
      'ObjectID': feature['OBJECTID_1'],
    }
  }
  Push(features,feat);
};

var joinedDict = {
  fields: [
    {name: 'Structure', alias: 'Structure', type: 'esriFieldTypeString'},
    {name: 'Condition', alias: 'Condition', type: 'esriFieldTypeString'},
    {name: 'Trail Name', alias: 'Trail Name', type: 'esriFieldTypeString'},
    {name: 'ObjectID', alias: 'ObjectID', type: 'esriFieldTypeString'}
  ],
  'geometryType': '',
  'features':features}


return FeatureSet(Text(joinedDict))
0 Kudos
0 Replies