Skip to main content
Enable back navigation to let respondents revisit questions and revise answers. You can also mark a question as a boundary: respondents may return to it, but cannot move back to earlier questions.
This guide describes PR #2577. Use an EDSL version containing that change. The PR adds schema controls, CLI options, and a local session API; hosted Back behavior also requires support in the Humanize application. Local session examples do not create a hosted survey.

Enable Back in a human survey

Set survey.navigation.back_button to True in the humanize schema. Back is disabled by default.
In this example, the respondent can go back from feedback to rating and revise the rating. At rating, Back is unavailable, so they cannot return to role. Preview the configuration, then use the same schema to create the human survey:
allow_back_past defaults to True. Setting it to False creates a boundary; it does not lock the boundary question’s answer. A boundary alone does not enable Back. These navigation fields require actual booleans (True/False in Python or true/false in JSON), and schema validation rejects unknown navigation fields.

Configure navigation with the CLI

For an existing survey.ep containing the questions above:
Repeat --no-back-past to mark more than one boundary. Both controls are also available on ep humanize schema set for updating an existing human survey. Omitting --back-button does not disable a previously enabled setting; to disable it, supply a schema with survey.navigation.back_button set to false. CLI stdout is a JSON envelope. Check status and read warnings after each command; stop on an error before creating the human survey.

Try a session locally

survey.start_session(humanize_schema=...) creates a stateful SurveySession. Starting a session does not collect responses remotely or run a model. Using the survey and schema above:
Call answer() with the current question’s name. It records the answer; call forward() separately to move on. The local session does not validate answer values or require an answer before advancing. Validate inputs in your renderer or collection code.

What changes when an answer is revised?

Moving back alone preserves the visited path and its answers. Moving forward without changing an answer follows that path again. Changing an existing answer removes all later visited items from the active path and invalidates their answers, even if the revised answer would ultimately take the same branch. Moving forward then recomputes the route using survey rules. The respondent must answer later questions again. This example changes a commute answer after answering a follow-up:
The old transit answer remains available for auditing, but is excluded from active answers. Answering that question again removes its entry from inactive_answers(). Every answer() call records a new revision, including a repeated value; only a changed value triggers downstream invalidation.

Session methods and history

Instructions appear as navigable items. Use forward() to advance past one without answering it. When Back is enabled, a local session can also return from EndOfSurvey to the last visited item; revising an answer there can change a stop-rule outcome. This does not imply that a submitted hosted response can be reopened. The final_* methods return snapshots of current state; they do not require completion or finalize the session. To preserve the navigation audit data, explicitly pass session.final_result_metadata() when constructing a Result. See Result metadata for an example.