Skip to content

Conversation

@chao-xian
Copy link
Contributor

@chao-xian chao-xian commented Oct 9, 2025

This was pretty confusing and creating this doc helped made it clearer to understand.

Rendered: https://github.com/alphagov/forms/blob/add-model-mapping/diagrams/mapping-forms-formdocuments.md

PR Checklist

  • If you are proposing a new decision record document, used the right template for that
    - (ADR, decision-record, engagement, research)
  • Set yourself as the Assignee
  • Tag anyone you would like to review, or @forms-design or @forms-devs
  • Fill in the template below

What

Describe what you have changed and why.

How to review

Describe the steps required to test the changes.

For example:

  1. Semantic: Do you agree with the changes?
  2. Syntactic: Spelling, grammar, etc.

Who can review

Describe who can review the changes. Or more importantly, list the people
that can't review, because they worked on it.

This was pretty confusing and creating this doc helped made it clearer to understand.
D -- points to --> G
E -- points to --> H
G -- points to --> I
```
Copy link
Contributor

@stephencdaly stephencdaly Oct 13, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this diagram makes a whole lot of sense. There isn't such a thing as a "check condition" or a "goto condition" really. We just have those associations on the page model to get all conditions where the check_page_id or goto_page_id point to the current page as it's sometimes useful to get these. If we want to explain how conditions relate to pages, I think the following is a better way to comprehend it:

The below diagram shows a primary condition (not sure whether we have a better name for these), which skips to Page 3 after Page 1 if the answer given to the selection question on Page 1 matches the answer_value of the condition. For primary conditions, the routing_page_id is always equal to the check_page_id.

flowchart TD
    Form[Form]
    Page1[Page 1]
    Page2[Page 2]
    Page3[Page 3]
    Condition[Condition]

    Page1 --> Form
    Page2 --> Form
    Page3 --> Form
    Condition -->|routing_page_id|Page1
    Condition -->|check_page_id|Page1
    Condition -->|goto_page_id|Page3
Loading

We can also have secondary skip conditions. These cause page(s) to be skipped later on in the form if any answer other than the answer_value was given to the question on the page that the check_page_id references. In this example if any answer other than the answer_value on the primary condition was answered, the user will proceed to Page 2. After answering the question on Page 2, Page 3 will be skipped and they will proceed to Page 4.

flowchart TD
    Form[Form]
    Page1[Page 1]
    Page2[Page 2]
    Page3[Page 3]
    Page4[Page 4]
    Condition[Secondary skip condition]

    Page1 --> Form
    Page2 --> Form
    Page3 --> Form
    Page4 --> Form
    Condition -->|check_page_id|Page1
    Condition -->|routing_page_id|Page2
    Condition -->|go_to_page_id|Page4
Loading

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TYSM @stephencdaly I'll update with these

@chao-xian chao-xian closed this Dec 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants