Hello,
I'm new to Arcade and even newer to creating Data Expressions in Dashboards. I have three fields that I can populate using Arcade in my AGO web map Configure Pop-Ups section. Unfortunately, as we all know, these type of calculated fields do not show up in Dashboards and Globals are not present. I've been reading over past postings and it seems the key for me would be to employ FeatureSetByPortalItem() and create a data expression inside Dashboards so this data can be used. The three fields are Temporal Block, Hour, and Weekday.
The code I'm using in AGO for Temporal Block is:
var t = Hour($feature.PresentDate);
When(
t >= 22 || t < 6, "Night (10pm - 6am)",
t >= 6 && t < 11, "Morning (6am - 11am)",
t >= 11 && t < 13, "Midday (11am - 1pm)",
t >= 13 && t < 17, "Afternoon (1pm - 5pm)",
t >= 17 && t < 22, "Evening (5pm - 10pm)",
"Invalid date" );
The code I'm using in AGO for Hour is:
Hour($feature.PresentDate)
And the code I am using in AGO for Weekday is:
Weekday($feature.PresentDate)
Can someone please help me or give me some hints at how to create an Arcade expression employing FeatureSetByPortalItem that will perform these calculations inside Dashboard?
Thank you so much in advance.
Jeff