Select to view content in your preferred language

Field Maps - how to set up auto fill?

100
11
yesterday
CassidyWheat
Emerging Contributor

I am creating a form for noxious weeds detections I currently have combo boxes for common name, scientific name, and weed class. I'd like to configure the form so when the user selects the common name, the scientific name and weed class auto populate. Does anyone have any idea how to accomplish this? Thank you! 

0 Kudos
11 Replies
CodyPatterson
MVP Regular Contributor

Hey @CassidyWheat 

Typically you'd just create an expression based on another field, something like this:

if ($feature.inspectionstatus == 'REW' && $feature.constructionstatus == 'REW') {
  return null
} else {
  return $feature.reworkprogress
}

So this field called "Progress" will return null wiping the field if the construction status or the inspection status fields are in the REW status. Using return places these into the fields. In your case I would have it check to see the value/domain value and return based on a condition! You can do this with as many fields as you'd like, let me know if you need any pointers for getting it setup!

Cody

0 Kudos
CassidyWheat
Emerging Contributor

Hi Cody! Thank you for this information. 

I would love some pointers. Is there a way to do this without coding? 

0 Kudos
CodyPatterson
MVP Regular Contributor

Hey @CassidyWheat 

Coding may be the easiest way to get this checked out, mostly due to it being able to drop directly into the information that each layer would have! If you're on ArcGIS Online or a supported Enterprise version you should have access to ArcGIS Assistant if it's available, which should be able to follow a prompt if you need that!

In terms of how it's done, lets say that you have 5 fields, Common Name, Scientific Name, Weed Class, Comments, and User Reporting. What I would do is something like this:

Common Name: Just keep it a drop down, no coding needed just yet since it's a choice list

Scientific Name: This would need some code, basically like this below:

if ($feature.commonname == "CreepingThistle") {
return "Cirsium arvense"
} else if ($feature.commonname == "SpearThistle") {
return "Cirsium vulgare"
}

(I have no idea if these are right, just guessing at this point!)

Weed Classification: This would be the exact same as above in terms of condition, something  like this:

if ($feature.commonname == "CreepingThistle") {
return "Hurts when touched"
} else if ($feature.commonname == "SpearThistle") {
return "Venom in spines or something"
}

Then your Comments, and User Reporting would be entered by the person out in the field, this would auto populate what you'd be wanting for these fields, pretty light on the coding so you wouldn't have to do much at all!

Cody

0 Kudos
CassidyWheat
Emerging Contributor

Screenshot 2025-11-25 133749.png

 After trying to code, this is the issue that I'm running into. Currently, I have a drop down menu for Common name, Scientific name, and Weed class and I'm trying to link them! 

Do you see anything off with my attempt at the code?

0 Kudos
CodyPatterson
MVP Regular Contributor

Hey @CassidyWheat 

That was my bad, I used the wrong equivalency check, I corrected it in my original reply, but this here should be about what yours should look like:

if ($feature.Common_Name == "Eggleaf spurge") {
return "Euphorbia oblongata"
}

You're just missing the double quotes after spurge and the ending curly braces.

Cody

0 Kudos
CassidyWheat
Emerging Contributor

Screenshot 2025-11-26 085735.png

It looks like I'm unable to select any common names from the Field Maps app when I try this code! 

thumbnail_IMG_0501.png

0 Kudos
CodyPatterson
MVP Regular Contributor

Hey @CassidyWheat 

You may have placed this expression on the Common Name field itself, I believe you should be able to take that expression off, and then apply it to Scientific Name, and it should now let you choose the Common Name I believe!

Cody

0 Kudos
EmilyGeo
Esri Regular Contributor

Hi @CassidyWheat

Yes you can do this without coding. You can create templates based on a field like common name, then set the default values for the other fields. 

 

EmilyGeo_0-1764104667830.png

 

0 Kudos
CassidyWheat
Emerging Contributor

Hi @EmilyGeo , this is what the template section looks like on my end. I'm not sure what "unassigned", "assigned", "in progress" and "completed" mean in this context. 

Screenshot 2025-11-25 134025.png

0 Kudos