> For the complete documentation index, see [llms.txt](https://docs.guardianservice.app/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.guardianservice.app/technical-information/users/standard-registry-users-schemas-and-policies/schemas/geo-fields/configure-geo-fields.md).

# Configure Geo Fields

Add Country, Continent, and State/Province fields and link them so they cascade.

Add Country, Continent, and State/Province fields to a schema and optionally link them so they cascade together in a form.

## Prerequisites

* You are signed in as a Standard Registry user.
* You have a schema open in the Schema Editor in **DRAFT** status.
* To link fields, you need at least two geo fields of compatible types in the same schema object, for example a Country and a Continent.

## Steps

### Add a geo field

1. Open the schema in the Schema Editor and add a field.
2. In the **Type** dropdown, open the **Geographic** group and select **Country**, **Continent**, or **State/Province**.
3. Enter a description for the field, for example `Project Country`.
4. Save the field.

Repeat for each geo field you want to add.

### Link fields into a cascading group (optional)

1. Select the child field, for example a Country field you want to depend on a Continent field.
2. Open the **Depends on** selector and choose the parent field. Only compatible parents are offered: Continent for Country, and Country or Continent for State/Province.
3. Save the field. Repeat for each child field you want to link.

A State/Province field may point directly to a Country without a Continent present. The group is formed from whatever fields are declared.

### Save the schema

Select **Save all**. The dependency links are stored in the schema's `$comment` fields and are restored the next time you open the schema.

### Verify in a generated form

Open the **Preview** tab in the Schema Editor, or run a [Dry Run](/technical-information/users/standard-registry-users-schemas-and-policies/policies/dry-run.md) of the policy that uses this schema.

* Selecting a country filters the State/Province dropdown to that country's subdivisions and fills in the Continent field.
* Selecting a state fills in its country and continent.
* Selecting a continent narrows the Country dropdown to countries on that continent.

### Export to Excel

1. Open the schema and export it to Excel.
2. In the downloaded `.xlsx` file, the geo fields appear with `Country`, `Continent`, or `State/Province` in the **Field Type** column.
3. If a child field has a parent, the parent appears in the **Parameter** column of the child row.
4. The **Test Value**, **Default Value**, and **Suggest Value** columns show display names for Country (`United States`) and Continent (`North America`). State/Province keeps its code in both directions, for example `CA-ON` for Ontario.

### Import from Excel

1. Fill in the **Field Type** column with `Country`, `Continent`, or `State/Province`.
2. To declare a parent link, enter the parent field in the **Parameter** column of the child row. The parent may be named by its key or by its description, and case and spacing are ignored. Leave **Parameter** blank to import the field without a parent.
3. Import the file. If the **Parameter** value matches no field at that level, or the pairing is not a legal ancestor relationship, the import result reports a row-level error naming the sheet, the row, and the offending cell, and the field is imported unlinked.

## Result

Each geo field in the form shows a searchable dropdown populated from the ISO 3166 dataset. Linked fields filter and auto-populate each other as the user makes selections. Submitted documents are validated on the server: field values must exist in the dataset, and linked fields must be mutually consistent.

A schema exported and re-imported preserves the field types and dependency links without manual edits to the `.xlsx` file.

## Related

* Concept: [Geo Fields](/technical-information/users/standard-registry-users-schemas-and-policies/schemas/geo-fields.md)
* Guide: [Import and Export Excel file User Guide](/technical-information/users/standard-registry-users-schemas-and-policies/policies/import-export-from-excel/import-and-export-excel-file-user-guide.md)
