Hi all
I'm fairly new to Arcade and programming and I've got myself a bit stuck so would welcome any help!
In AGOL, I have a hosted feature layer that I'm using in a Dashboard. I want to add in indicators that do some calculations e.g. sum, minimum, maximum.
However, the dataset has a lot of fields that I don't really want to manually list out. The fields that will be used in the calculations all have field names that have the prefix "D_". I am able to create the result I want by listing the fields used in the calculation:
var fields = [
$datapoint["D_20210913"],
$datapoint["D_20210925"],
$datapoint["D_20211007"],
$datapoint["D_20211019"],
$datapoint["D_20211031"],
$datapoint["D_20211112"],
$datapoint["D_20211124"],
...
]
var minimum = min(fields)
var rounded = Round(minimum,3)
return {...}
What I'm wondering is, is it possible to use Find and a For loop etc. to list out all the fields that have field names containing "D_"?
@XanderBakker I'd appreciate any help 🙂
Many thanks!
Alice