Field Maps - Required Fields Not Working as Expected

630
10
Jump to solution
02-23-2021 07:56 PM
Tolo__AdamTolo
Occasional Contributor

Hey all,

I have been using ArcGIS Field Maps mobile and have noticed that the fields I have setup as "Allow Null" = False, don't need to be filled out when i tap "Submit".

I setup the form for the layer using ArcGIS Field Maps web app and the fields have the "Required" marked as True.

Tolo__AdamTolo_0-1614138740763.png

In the Field Maps mobile app, I have the asterisk next to the field indicating that the field is a required field.

In Beta, I noticed that it was released in October:

Tolo__AdamTolo_1-1614138964149.png

Is anybody else experiencing this?

 

1 Solution

Accepted Solutions
AaronPulver
Esri Regular Contributor

Templates can be defined in ArcMap or Pro and then will be published as part of the feature service. You can manage templates in two places in ArcGIS Online:

1. In Field Maps web

2. In Map Viewer (Classic)

In Field Maps web if you open the map and select the layer, then select the Templates tab you can configure the default values for each attribute for each template. If you click on an attribute, you can backspace to remove the empty values and then when you Save the layer it will write null to the feature layer template default value(s), which is what you want in this case. The same thing applies for numeric fields.

AaronPulver_0-1616453848448.png

 

If you have many layers that you want to fix, you can use this script/toolbox.

 

@CharliePhilbrick1I checked your layer and you have the same problem.

View solution in original post

10 Replies
CharliePhilbrick1
New Contributor III

I too am experiencing this. I published the service I'm using from ArcGIS Pro and while the expected fields shows up in field maps with the '*' indicating that it is required I can Submit features without even touching those fields. 

Perhaps related issue: I have two fields that have no default value set that are populating in field maps as '0' (zero). Strange behavior. Worse, this is behavior that undermines what I consider to be essential functionality of the app and underlying stack - this is a key way that we maintain data quality in our field collection efforts.

If anyone has some insight for @Tolo__AdamTolo and me, please pass it on!

AaronPulver
Esri Regular Contributor

Can you check your feature layer templates (specifically the layer definition json)? It's possible that the default values for those fields are set to empty strings or 0 instead of null. Since there technically is a value applied by default, the submit button will allow you submit the feature.

You will not be able to see this difference in Field Maps web - you have to look at the layer definition (json). There is also a script for Collector (but it applies here too) that can change those value to null. Field Maps web does not inspect the default values of the template, it only checks the nullability of the field.

CharliePhilbrick1
New Contributor III

Thanks for your quick reply, Aaron.
Digging in to the json sounds like good actionable advice, however when I attempt to access the REST endpoint for the service, I get a 'Token Required' error.
Would it be helpful to share this AGO item with you? I don't know what all you need to know about my account and how this service was created, but here's a little: I created it in Pro and shared as a web layer to my organizational account where I have a Creator account type. I'm happy to provide more details if they could help me past this Token-related roadblock.

Thanks again,
Charlie

0 Kudos
Tolo__AdamTolo
Occasional Contributor

So the default value is null:

Tolo__AdamTolo_0-1616370579886.png

Interestingly, when I click on the field, I have noticed that little number '1' in the right hand side. If I back space, I then am not able to submit the sighting before completion.

Tolo__AdamTolo_1-1616370969691.pngTolo__AdamTolo_2-1616371004211.png

Looks like there is an empty space.

Also my fields that have domains and are not free text behave the same. I can submit a feature without filling out the required field but if I select one of the domain values and then go back to selecting no value, then I can't submit the feature.

Looks like a bug to me?

0 Kudos
AaronPulver
Esri Regular Contributor

@Tolo__AdamToloThe first screenshot you sent is looking at the field default value. Collector and Field Maps uses the default value store in the "templates" property, not the fields default value. The behavior you are seeing does align with my hypothesis regarding your templates.

This is where you need to check (you may have multiple templates within the "types" array):

AaronPulver_0-1616422052291.png

 

@CharliePhilbrick1Yes if you and/or @Tolo__AdamTolo want to share your layers with me you can add the map and layers to a group and then invite the "arcgisfieldmaps" username to that group.

0 Kudos
CharliePhilbrick1
New Contributor III

Thanks again, @AaronPulver for engaging on this stuff.
I've just invited 'arcgisfieldmaps' to join a group called 'ESRIFieldMapTesting'. Let me know how you'd like to proceed from here.

0 Kudos
Tolo__AdamTolo
Occasional Contributor

@AaronPulver you are right.

Tolo__AdamTolo_0-1616450606747.png

So my question is where did this get set? I definitely did not set it up like this.

I will have a bit of a play around and report back.

0 Kudos
AaronPulver
Esri Regular Contributor

Templates can be defined in ArcMap or Pro and then will be published as part of the feature service. You can manage templates in two places in ArcGIS Online:

1. In Field Maps web

2. In Map Viewer (Classic)

In Field Maps web if you open the map and select the layer, then select the Templates tab you can configure the default values for each attribute for each template. If you click on an attribute, you can backspace to remove the empty values and then when you Save the layer it will write null to the feature layer template default value(s), which is what you want in this case. The same thing applies for numeric fields.

AaronPulver_0-1616453848448.png

 

If you have many layers that you want to fix, you can use this script/toolbox.

 

@CharliePhilbrick1I checked your layer and you have the same problem.

View solution in original post

Tolo__AdamTolo
Occasional Contributor

Ohhhh. Thanks that clears things up a lot @AaronPulver 

So by default, after publishing, I need to go through and adjust this template? FieldMaps web seems to have put in spaces for free text fields and for the fields with domain lists, I have to select the value "Not selected" so that message "must match one of the options" does not show up.

Tolo__AdamTolo_0-1616455710872.png

Would think it would default to these from the start?

 

0 Kudos