Hi,
I have trouble validating an attribute rule using a dictionary as source (using ArcGIS Pro 3.2.1).
My input is a JSON string (generated by another rule with priority 1):
{"Dataset1":[], "Dataset2": ["text", "more text"]}
I am using this expression to parse the JSON:
var out = null;
var dataset = "Dataset2";
var dict = FromJSON(Text($feature.json));
var arr = dict[dataset];
if (IIf(DefaultValue(arr, 0) == 0, false, true)) {
out = Concatenate(arr, ", ");
}
return out
Using the expression in a popup works, as attribute rule the validation always fails at line 5:
Arcade Error, unexpected null
It seems like the dictionary isn't parsed properly as long as I try to use it in an attribute rule.
Returning the dictionary as out works, the validation then complains about dict not being a string.
Returning out = Text(dict) returns the initial JSON string.
What am I doing wrong here?