If the values in one field of a layer or table dictate or restrict the values that are valid for another field in that same layer or table, you can define these contingencies to help ensure editors use the correct values.
Each of the fields should have a domain list or range defined for it. Having a finite list or range of values allows you to specify, for example, that when a particular value is set for one field, it means only a certain set of values are valid for another field. This restriction enforces data integrity by applying additional constraints that reduce the number of valid field values.
To define which fields are dependent on or dictate the values of other fields, create a field group that contains those fields.
The following is a summary of how you define contingent value combinations for a layer or table in a hosted feature layer or hosted table:
- Identify the fields that have interdependent values.
- Ensure domains are defined for those fields.
- Create a field group containing the fields.
- Define the contingent value combinations for the fields in the field group.
Note:
Keep the following in mind:
- Field groups and contingent value combinations defined in ArcGIS Online cannot be edited or deleted in ArcGIS Pro.
- Field groups and contingent values cannot be defined for a hosted feature layer that contains a multipatch layer.
- Before you can edit or delete a range domain, you must delete all field groups that reference the field that has the domain applied to it.
- You cannot delete a domain list that is part of a contingent value combination, but you can edit the labels (the displayed values) for the domain, and you can add label and code values to the domain list.
Field groups
A field group provides the framework to enforce contingent values because it defines which fields contain values that are contingent upon one another.
Field groups must contain at least two fields from the same layer or table. Each field group must contain a unique set of fields.
Create a field group
To create a field group, complete the following steps:
- Sign in to your organization.
You must be the hosted layer owner, a member of the default administrator role, or a member of a custom role that has the set of administrative privileges to manage all content owned by organization members.
- Open the item page of the affected hosted feature layer or hosted table.
- Click the Data tab, and click Contingent values.
- Use the drop-down menu to select the layer or table that contains the fields that have interdependent values.
- Click Create field group.
- Provide a name for the field group.
Field group names must be unique. They can contain up to 128 alphanumeric characters, underscores, or spaces, but they must start with an alphabetical character.
Once created, you cannot change the name of a field group or the fields that it contains; however, you can change the Restrictive setting.
- Use the Restrictive toggle button to define whether the combinations defined for the fields are enforced or are guidelines as follows:
- Restrictive toggle button on—The contingent value combinations are enforced; editors cannot apply values that do not honor the rules you define.
- Restrictive toggle button off—In this nonrestrictive state, editors are presented the list of valid contingent values, but they can use a different value that is supported by the domain set for the field.
Note:
This nonrestrictive state does not apply in web clients, such as Map Viewer, Scene Viewer, and ArcGIS Web Editor. In web clients, the editors can only use the values you defined for the contingent value combinations.
- Check the check box next to each field that has interdependent values.
- Click Create.
Next, define the contingent values for the fields in the group.
Open a field group
To open the fields and contingent value combinations for an existing field group, complete the following steps:
- Sign in to your organization.
You must be the hosted layer owner, a member of the default administrator role, or a member of a custom role that has the set of administrative privileges to manage all content owned by organization members.
- Open the item page of the affected hosted feature layer or hosted table.
- Click the Data tab, and click Contingent values.
- Use the drop-down menu to select the layer or table that contains the field group.
- Do one of the following:
- From the Layers drop-down menu, choose the layer or table for which the field group is defined, and choose the field group from the Field group drop-down menu.
- Click Browse field groups, select the field group from the list under Names, and click View contingent values.
Delete a field group
Before you can delete a field group, you must first delete all contingent value combinations set for it.
Caution:
Field groups are immediately deleted and cannot be recovered.
To delete a field group, complete the following steps:
- Open the field group.
- Delete all contingent values defined for the field group.
- Click Browse field groups.
- From the list under Names, select the field group that no longer contains any contingent value combinations.
- Click Delete field group.
Define contingent values
When you have the interdependent fields in a field group, complete the steps below to define what values, per field, are contingent on the others.
You can define as many contingent value combinations as you require.
You must choose a value for every field in the field group for each contingent value combination that you define.
For fields that have domain lists, choose one of the values from the list. For fields that have a domain range, define minimum and maximum values inside the existing domain range. Alternatively, you can choose one of the following for any of the fields in a contingent value combination:
- [ANY]—This field can contain any allowed values.
- [NULL]—If the field is configured to allow null values, editors must leave the field null in this combination if you assign this value.
Tip:
[ANY] and [NULL] are the only options available for fields that do not have a domain applied to them.
- Open the field group.
Tip:
When you first create a field group, it immediately opens the Contingent values view of that field group.
- If the layer was published from data in ArcGIS Pro that has subtypes defined, choose the subtype for which you'll define the contingent values.
- Click inside an empty cell below a field in the group.
- Choose the value or define the range subset that affects the allowed values for the other field or fields in the field group.
- Click inside the corresponding cells for the other fields in the group, and choose the values and set the ranges that correspond to the first value or range you set.
- To accept the values, click the check mark in the row for the contingent values combination that you added.
To delete this value combination, click the Cancel button
. - Click Save
in the row for the contingent value combination that you added.You must save the value combinations or they are not added to the field group. You can save them individually, or wait until you define all value combinations and click Save all changes.
If you don't want to save any of the combinations you added, click Reset to remove them, or click the Reset button
next to the individual combinations you don't want to save. - Repeat steps 2 through 7 as needed to define more contingent value combinations.
Manage contingent values
You can change the values, retire a value combination to prevent it from being used going forward, or delete value combinations.
Change values
You can change the values for any of the contingent value combinations.
To change values, complete the following steps:
- Open the field group.
- Click in the cell for the value to change, and choose a new value or define a new range.
If the field group is restrictive, do not change the value to violate existing value combinations.
- If you decide not to save the changes, click the Reset button
. - Click Save
in the row for the contingent value definition that you altered or click Save all changes. - Repeat steps 2 through 4 as needed.
Retire contingent value combinations
To retire a contingent value combination that applies to existing data but mustn't be used for new values, complete the following steps:
- Open the field group.
- To retire a single contingent value combination, click Retire
next to the combination to be retired, and click Save
in the row of the retired combination. - To retire multiple contingent value combinations, check the check box next to each one to retire, click Retire selected at the top of the list, and click Save all changes at the bottom of the list.
The retired contingent value combinations no longer appear in the Contingent values list.
Restore a retired combination
To restore a retired contingent value combination, complete the following steps:
- Open the field group.
- Click Retired combinations
.The view changes to show a list of all retired contingent value combinations for this field group.
- To restore a single contingent value combination, click Restore
in the row of the definition to restore, and click Save
in the same row. - To restore multiple contingent value combinations, check the check boxes next to each one to restore, click Restore selected at the top of the list, and click Save all changes at the bottom of the list.
- Click Done or Retired combinations
to return to the Contingent values view.
The retired contingent value combinations are back in the list of contingent values for this field group and are active.
Delete contingent value combinations
To delete a contingent value combination that is no longer needed, complete the following steps:
Caution:
Contingent value combinations are immediately deleted when you save and cannot be recovered.
- Open the field group.
- To delete a single contingent value combination, click Delete
next to set of values, and click Save
. - To delete all contingent value combinations for one or more field groups, do the following:
- Open the Settings tab of the item page for the hosted feature layer or table that contains the contingent value combinations.
- Scroll to the Feature layer (hosted) section.
- If the hosted feature layer item contains multiple layers, choose the correct layer from the Layers drop-down menu in the Contingent values section.
- Click Delete contingent values.
- Check the check box next to the field group or groups for which all contingent value combinations will be deleted, and click Delete.
- To delete multiple combinations for a single layer or table, check the check box next to each definition to delete, click Delete selected at the top of the list, and click Save all changes at the bottom of the list.
Export field groups and their contingent value combinations
To export a .zip file containing comma-separated values (.csv) files—one that defines the field groups and one that contains the definitions of the contingent value combinations—complete the following steps:
- Open the Settings tab of the item page for the hosted feature layer or table that contains the contingent value combinations.
- Scroll to the Feature layer (hosted) section.
- If the hosted feature layer item contains multiple layers, choose the correct layer from the Layers drop-down menu in the Contingent values section.
- Click Export contingent values.
A .zip file containing the .csv files is immediately written to your local downloads folder.
Example use of contingent value combinations
In a feature layer that stores zoning information for parcels, the zone defined for a parcel determines the types of buildings that can exist on the parcel, and the number of buildings allowed.
A field group is created that includes the following fields:
| Field | Domain type |
|---|---|
zone_code | List domain containing zoning codes |
building_type | List domain containing building types; allowed values are dependent on the code set in the zone_code field. |
num_buildings | Range domain defines the full range of values allowed (0–12); a subset of more restrictive ranges apply depending on the value in the zone_code field and the value of the building_type field. |
For example, you could define the following contingent residential zoning code, building type, and range of allowed number of building value combinations:
| Zone_code value | Possible values for building_type | Range allowed for num_buildings value |
|---|---|---|
R1 | Single-family home | 0–1 |
RD2 | Single-family home | 0–2 |
RD2 | Duplex | 0–1 |
RD6 | Single-family home | 0–6 |
RD6 | Duplex | 0–3 |
RD6 | Triplex | 0–2 |
With these combinations defined, if an editor designates a parcel RD2—which allows for two residences—there can be 0, 1, or 2 single-family homes on the parcel or 0 or 1 duplexes on the parcel.