Good afternoon, I am attempting to build a Data Expression for a serial chart in a Dashboard (Enterprise 11.5) using some code snippets produced from ChatGPT. I have beginner Arcade skills. I want to calculate miles of water main sorted in ten-year age bins from today's date. I have fields 'measuredlength' (feet) and 'installdate' (M/D/Y) from our water Utility Network 'water main' asset group records. The current code (attached) runs in the test window, but apparently no new fields are being created to use in the serial chart. Though the expression is selected in the Data pane of the configuration screen for the serial chart element, the fields AgeBin, SortOrder, and Miles are not listed, only the fields from the original feature layer are listed when I attempt to choose the Category field under Grouped values.
The inbound FeatureSetByPortalItem step containing the fields I want to include, is working. The output pane is showing the imported data.
Any help would be greatly appreciated. Regards, Jay