I would like to create an arcade expression in Map Viewer at the form section to be able to select a category and when I select from the category dropdown it specifies the selectable options in the type field.
Category : Maintenance & Safety
Type : Graffiti Removal, Tresspassing, Sidewalk Cleaning, Trash Removal, Request Safety Assistance, Other (Please Describe), Homeless Outreach, Request Safety Escort
So when I open the Instant App and trying to submit a report and select the category, like Maintenance, in the type field I would have only these options Graffiti Removal, Sidewalk Cleaning, Trash Removal, Other (Please Describe), Homeless Outreach and when I select Safety as category I would have these options to choose from: Tresspassing, Request Safety Assistance, Other (Please Describe), Request Safety Escort.
I have tried many expressions and none of them worked.
Help would be appreciated with this.
This is the closest that I got, but like this I am not able to select from the combo box dropdown as you can see on the picture. These values for category and type are domain values
var category = $feature.reqcategory;
var reqType = $feature.reqtype;
if (category == "Maintenance") {
return ["Graffiti/Sticker Removal", "Sidewalk Cleaning", "Trash Removal", "Homeless Outreach", "Other (Please Describe)"];
} else if (category == "Safety") {
return ["Trespassing", "Request Safety Assistance", "Request Safety Escort", "Other (Please Describe)"];
} else {
// Return all options when no category is selected
return ["Graffiti/Sticker Removal", "Sidewalk Cleaning", "Trash Removal", "Homeless Outreach", "Other (Please Describe)", "Trespassing", "Request Safety Assistance", "Request Safety Escort"];
}