Note: This tool applies to working with Hosted Feature Services in ArcGIS Online or Portal. If you're working with ArcGIS Server Feature Services there is a different workflow to utilize, please go here.
Sets the "required" fields to be null rather than white-space or 0 in the service definition template information.
Supported in ArcGIS Pro 2.0+
Fields are said to be "required" in ArcGIS Collector if the field is not nullable. In the template information in the layer definition file, some of these fields are set to blank white-space (" ","") or to 0. These template values then auto-populate the fields in the Collector app meaning the end-user doesn't have to enter anything, when in reality, they should be forced to enter a value.
Script takes the following parameters as input
- Organization Url
- Username
- Password
- Feature Service ItemId
Instructions to run the script
- Connect to the folder containing the "CollectorUtils_Pro" toolbox
- Double click on the "CollectorUtils_Pro" toolbox that should be shown in the catalog/project area
- Under GeneralUtils toolbox double click the "Reset Required Fields (Python api)" script tool
- Enter required input parameters
- Click Run
Run the reset_required_fields_python_api.py script in Python 3.4+ as (omit the '{}' brackets for the arguments):
See Require the information you need from the field for more about this tool.