> 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/cross-schema-conditions/configure-nested-and-cross-schema-conditions.md).

# Configure Nested and Cross-Schema Conditions

Set up a condition whose trigger or targets live inside referenced sub-schemas.

Set up a condition where the trigger field, the controlled fields, or both live inside referenced sub-schemas.

## Prerequisites

* You are signed in as a Standard Registry user.
* The schema you are editing is in **DRAFT** status and already has at least one field of type **Sub-Schema** referencing a loaded sub-schema.
* For cross-schema conditions, you need at least two Sub-Schema fields referencing different sub-schemas.
* Neither the trigger field nor the target field is inside a repeatable (array) sub-schema. Those fields are not offered in the pickers.

## Steps

### Use a nested field as the trigger

1. Open the schema in the Schema Editor and switch to the **Conditions** tab.
2. Select **Add condition**.
3. Leave the block set to **IF** for a single rule, or choose **IF ALL** or **IF ANY** if you plan to add more than one rule.
4. Under **When**, open the field picker. Fields are grouped: the parent schema's own fields at the top, then one group per referenced sub-schema, labeled with the sub-schema's name.
5. Select a field from one of the sub-schema groups.
6. Enter the match value to the right of the picker. Fields with a fixed set of values offer a **Select value…** dropdown; others take free text.
7. To add another rule to the same block, select **Add condition row**.

### Add cross-schema targets to a THEN or ELSE branch

1. In the **THEN** column, open the **Ref field** dropdown and select a field from a sub-schema. If the dropdown reads **(no sub-schema fields)**, the schema has no eligible referenced fields.
2. To control a whole block rather than one field, choose an option carrying the **Sub-schema** badge. That adds one target for the entire block instead of one target per field.
3. The target appears in the branch as a path, for example `Project Details › Location › region`. Use **open** to jump to the target schema, or the close control to remove the target.
4. Repeat in the **ELSE** column for fields that should appear when the condition does not match.
5. Use **New field** in either column to create a field that lives directly on this schema rather than in a sub-schema.

### Save the schema

Select **Save all**.

## Result

When a user fills in the parent form:

* The trigger value is read from the field inside its sub-schema.
* When it matches, the **THEN** targets appear in their own sub-schemas.
* When it does not match, the **ELSE** targets appear instead, and the **THEN** targets are hidden and must not be submitted.

## Troubleshooting

**Sub-schema fields do not appear in the picker.**\
The sub-schema must be fully loaded in the editor. If a group is missing, check that the Sub-Schema field has a valid schema type assigned and that the referenced schema is available in your policy context.

**A field I expected is missing from the picker.**\
Fields inside a repeatable (array) sub-schema are excluded by design, as is the repeatable container itself. See [Cross-Schema Conditions](/technical-information/users/standard-registry-users-schemas-and-policies/schemas/cross-schema-conditions.md) for why.

## Related

* Concept: [Cross-Schema Conditions](/technical-information/users/standard-registry-users-schemas-and-policies/schemas/cross-schema-conditions.md)
* Task: [Creating Schema using UI](/technical-information/users/standard-registry-users-schemas-and-policies/schemas/creating-schema-using-ui.md)
* Reference: [Conditional and Visibility Logic](/technical-information/users/standard-registry-users-schemas-and-policies/schemas/best-practices-to-implement-schema/conditional-and-visibility-logic.md)
