I'm using the following data expression for both my category selector and my serial chart widget.
// Reference layer using the FeatureSetByPortalItem() method.
var fs = FeatureSetByPortalItem(Portal('https://www.arcgis.com'), '404e68025b454f829385dfaa326d0486' , 0, ["*"], false);
// Empty dictionary to capture each sub topic reported as separate rows.
var choicesDict = {'fields': [{ 'name': 'Split_SubTopic', 'type': 'esriFieldTypeString'}, { 'name': 'Topic', 'type': 'esriFieldTypeString'}, { 'name': 'Chamber', 'type': 'esriFieldTypeString'}, { 'name': 'Enacted', 'type': 'esriFieldTypeString'}],
'geometryType': '',
'features': []};
// Split comma separated sub types and store in dictionary.
for (var f in fs) {
var Topic = f["Topic"]
var Chamber = f["Chamber"]
var Enacted = f["Enacted"]
var split_array = Split(f["Sub_Topic"], ';')
for(var i in split_array) {
Push(choicesDict.features, {"attributes": {"Topic": Topic, "Chamber": Chamber, "Enacted": Enacted, "Split_SubTopic": Trim(split_array[i])}})
}
}
var result = Replace(choicesDict, "_", " ");
// Convert dictionary to featureSet.
var fs_dict = FeatureSet(Text(result));
return fs_dict
In the serial chart I'm using categories from grouped values on the category field Split SubTopic.
In the category selector I'm also using categories from grouped values with the category field of Split SubTopic.
The category selector works on widgets with other data sources but the serial chart with the same data expression as the source displays a "Cannot access data" error when it is filtered.
Does anyone have any ideas why this might be?
Solved! Go to Solution.
I was able to resolve this issue by removing the _ from the field name. I switched Split_SubTopic to SplitSubTopic.
I was able to resolve this issue by removing the _ from the field name. I switched Split_SubTopic to SplitSubTopic.