Select to view content in your preferred language

Instant App a field selection specifies another field options to choose from in the form

111
1
12-12-2024 05:47 AM
ggregor_pulsiam
New Contributor

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.

0 Kudos
1 Reply
ggregor_pulsiam
New Contributor

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

ggregor_pulsiam_0-1734013777316.png

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"];
}

0 Kudos