End of Form Navigation - Conditional Expression from Registration Form

Hello,

I'm having issues using the End of Form Navigation function. I'm trying to have it go from a registration form ("Register New Patient") for a case to a followup form ("Continue with Registration") for the case that was just created based on a logical expression. The forms are in different case lists (just so that I could have different menu modes), but both are set for the same case type.

The error I'm getting when trying to submit the registration form appears at the top of the form after the form fails to submit:

Logic references instance(commcaresession)/session/data/case_id which is not a valid question or value.

I've attached a screenshot of how I set up the end of form navigation. It seems as if it can't access the case_id from the registration form because the form is creating the new case. When I remove the conditional logic at the end of form navigation works as expected, but I only want it to navigate to the second form based off of the value of a case property.

Is there a different way (other than "instance('commcaresession')/session/data/case_id") to access the case_id for a newly created case in the end of form navigation?

Thank you,
Alejandro

The variable used for new cases should be something like this, assuming your case type is patient:

instance('commcaresession')/session/data/case_id_new_patient_0

I think if you change to that it should work as you've got it set up.

1 Like

Thanks @Ethan_Soergel . Appreciate your quick response. That solved the problem.