Select to view content in your preferred language

FeatureSetByName for Dashboard Serial Chart not working

712
2
Jump to solution
07-25-2023 03:20 PM
Labels (1)
DChavis
New Contributor II

I am attempting to use the following code to count the objectID from multiple feature layers into one chart for my dashboard.

var features = FeatureSetByName($map,'Bike routes', ['*'], true);Count(features);
  
 
 
var features = FeatureSetById($map,'DemoLayerWM_1117', ['*'], true);Count( features );

I have attempted the code in various forms, including combining the layers into a group layer and using the group layer name as the input, attempting to create a feature set from one individual feature layer, and attempting with the multiple feature layers together(desired). I have used all of the following variations, none of which are working for my dashboard. The error highlighted is always one of the following "$map", "$datastore", "FeatureSetByID", or "FeatureSetByName".

 

Has anyone else encountered the same or similar problems and found any solutions? Thank you.

0 Kudos
1 Solution

Accepted Solutions
JohannesLindner
MVP Frequent Contributor

Here is the documentation of the Arcade Dashboard Data profile: https://developers.arcgis.com/arcade/profiles/dashboard-data/

From there:

Profile variables

This profile does not provide any profile variables.

So you don't have access to the profile variables you are used to from other profiles, like $map, $datastore, or $feature. Instead of FeaturesetByName, use FeaturesetByPortalItem.

 


Have a great day!
Johannes

View solution in original post

0 Kudos
2 Replies
JohannesLindner
MVP Frequent Contributor

Here is the documentation of the Arcade Dashboard Data profile: https://developers.arcgis.com/arcade/profiles/dashboard-data/

From there:

Profile variables

This profile does not provide any profile variables.

So you don't have access to the profile variables you are used to from other profiles, like $map, $datastore, or $feature. Instead of FeaturesetByName, use FeaturesetByPortalItem.

 


Have a great day!
Johannes
0 Kudos
DChavis
New Contributor II

Thank you! I was able to successfully create a serial chart with the portal item code, but I am now having trouble with using a category selector (using the exact same code as the serial chart) on the serial chart. It has a yellow triangle in the corner of the chart and says "cannot access data", but other types of category selectors are working fine with this chart. 

To be more specific, my serial chart is pulling these three attributes ( trail name, asset condition, and asset type), from 3 different various layers. The serial chart is displaying how many types of assets of each quality there are. The category selector is filtering by trail name. This category selector works perfectly fine with the map and with other charts, but is unable to load the data for this chart. 

Is this something you have encountered before?

0 Kudos