if/else expressions in Arcade / Field Maps to show only certain domain values?

444
4
04-02-2021 12:27 PM
Labels (3)
ZacStanley3
New Contributor III

Hi All-

Is it possible in the field maps form to use if/else conditionals to show available fields and/or domains? I’m working on some fire fuel treatment mapping and the domains are quite extensive and would like to be able to let the user be able to do the following:

 

Select a category such as:

 

Biomass

Experimental

 

When that category is selected only show the available domains for that category:

Biomass

                               

Chipping

Lop and scatter

Masticate

Mobile biomass facility

Pile burn

Truck to biomass facility

 

Experimental

 

Assisted migration

Inoculation reduction

Test new vegetation management tools

 

I'm not sure if this is possible. If so, anyone have some syntax they can share? 

 

Thanks in advance.

4 Replies
DavidPike
MVP Frequent Contributor

Not an AGOL or Field Maps user, but can you just create Subtypes for those categories then particular domains to each subtype/category? 

0 Kudos
ZacStanley3
New Contributor III

That's a good suggestion. I was just hoping Field Maps had this capability, I don't know Arcade well enough to figure out.

0 Kudos
Woodpecker
New Contributor II

Looking to set up something very similar. Did you come across the solution by any chance? 

To answer the other suggestion with the subtypes: You can do it in Field Maps, but some other ESRI Apps won't allow you to work with subtypes, so I am basically just trying to avoid them. 

0 Kudos
Woodpecker
New Contributor II

I had a very similar issue and solved it with Decode function. So in your case, you would do something like this: 

Decode($feature["fire_fuel_treatment"],

"biomass", ["chipping", "lop and scatter", "masticate", ""],
"experimental", ["assisted migration", "inoculation reduction", "test new vegetation management tools", ""],
, "")

Not 100% sure if it works in Field maps, as I used this script in a different app, but I don't see a reason why it wouldn't.  

0 Kudos