Hello,
I am looking for a way to use Arcade in Dashboards to return the day of the year from a date field.
Due to the lack of Globals in Arcade for Dashboards, I have first called the FeatureSet using FeatureSetByPortalItem.
var p = 'https://www.arcgis.com'
var itemId = '998628deb4b144e8a17afd9ab606d700' // note this is an example ID from a different service
var fs = FeatureSetByPortalItem(Portal(p), itemId, 0, ['*'], false)
I am then looking for a way to use either the ISOWeek or Text functions (Text(date, DDD) to return the week or day from a date field within the FeatureSet. So far I've been unsuccessful in finding a way to pull out the date field (called RecordDate_rep) from the FeatureSet to then call the week/day functions mentioned above. I presume I'm missing something obvious, but any help is appreciated.
I was then attempting something like this, but it doesn't work, returning "Execution Error:Runtime Error: Cannot call member property on object of this type.":
var dat = fs.RecordDate; // extract Date field from FeatureSet
var day = Text(dat, 'DDD'); // Format date as day of year
return day; // output day of year
@XanderBakker if you are able to assist on this I would greatly appreciate it.