When you build your CommCare application, you can define the screen that will direct users after they submit a form instead of returning to the home screen. This feature is called End of Form Navigation, and it offers four options for users to choose from, depending on the application configuration: Home Screen, First Menu, Previous Screen, and Link to another form or menu.

https://youtu.be/wWmMG2ifc7A?si=t9ksSGoUjjIkmWql

Table of Contents:

Overview

Here's an overview of each option:

How to configure End of Form Navigation

Below are the steps to configure the end of form navigation:

Step-1: While editing your form, select the option to manage a case. 

select Manage case.png

Step-2: Activate the option to show the logic, allowing you to configure the end of form navigation..

step2.png

Step-3: Select the desired option from the menu.

step3.png

If you select "Link to another form or menu" you will need to specify a target form and may need to set up a conditional expression to determine whether the form should be presented to the user. Here's how:

form_link_setup.png

Target Form

Specify the form that will open once the user submits the current form.

Linking Data

If the target form is located in a module that caters to a different case type than the current form, you may need to specify the case_id of the case that CommCare will need to load. In most scenarios, if the case_id is the same as the current form, Commcare can manage this independently, and no user intervention is required.

Conditional expression

If the decision to link to the target form is dependent on a condition being met, you will need to specify a conditional expression. This expression must return a boolean value (true or false). Note that in the context of the form link conditional expression, form content is unavailable, so the expression must rely solely on case properties.

In the context of the form link conditional expression, form content is not available, so something like /data/some_question=’yes’ wouldn’t work. The expression below is an example of a expression that could be accepted if the property link_form is saved to the case. This expression gets the case from the case database (casedb), based on the ID stored in the user session, and verifies whether the property link_form is equal to ‘Yes’. If the expression returns 'true', the target form will be presented to the user, otherwise Commcare will move to the next condition, if applicable, or fallback to one of the default options.

conditional_expression_example.png

Navigation fallback - select where the user should navigate to if that form is not available (for example, if the form is hidden for that case, if the form is hidden for that user, or if the the data needed for the form to open has not been provided). For example, let's say there's a registration form that links to a follow-up form right after it. But only supervisor can do follow-up. If there is a display condition that hides the follow-up form form the normal user and the normal user finishes a registration form, CommCare can’t follow through with the end of form navigation, so it sill fall back on any menu or page you specified in the Navigation Fallback setting. If a supervisor finishes a registration, the form is accessible and end of form navigation happens.

Note: The Case ID is not always referenced in the session as case_id, this varies depending on the form and module configurations. 

Advanced Concepts

Form linking is conditional on a case property being met, the XPath Expression must reference the specific case from the casedb.

Limitations

There are some limitations to End of Form Navigation:

image2019-8-20_18-1-11.png