Display Logic

181 views
Skip to first unread message

leb...@mail.harvard.edu

unread,
Jun 24, 2016, 10:45:50 AM6/24/16
to commcare-users
Hello, I am somewhat new to CommCare. I'm currently building our questionnaires into the site and I had a question I can't seem to find an answer to. Is there any way to, upon completion of one form, have another form start 5% of the time? There is a less elegant way I could do this, but if there is a way in CommCare that would be preferable. Thanks!

Jeremy W.

unread,
Jun 24, 2016, 2:15:36 PM6/24/16
to commcar...@googlegroups.com
Hello,

I am not aware of any way to explicitly link from one form to another form. You could either use display logic within the form or you could use form filtering and case management so that a second form is displayed only for those users that require the second form (https://confluence.dimagi.com/display/commcarepublic/Form+Display+Conditions).

Jeremy

On Fri, Jun 24, 2016 at 10:45 AM, <leb...@mail.harvard.edu> wrote:
Hello, I am somewhat new to CommCare. I'm currently building our questionnaires into the site and I had a question I can't seem to find an answer to. Is there any way to, upon completion of one form, have another form start 5% of the time? There is a less elegant way I could do this, but if there is a way in CommCare that would be preferable. Thanks!

--
You received this message because you are subscribed to the Google Groups "commcare-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to commcare-user...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Jeremy Wacksman
Dimagi, Inc.

Eric Stephan

unread,
Jun 27, 2016, 1:49:27 AM6/27/16
to commcare-users


Since I don't know what your actual context is, let me propose one scenario, which might be totally not workable in your situation. You will have to understand a bit about case management and creating "child cases."  It's not incredibly hard if you have learned CommCare.

-- Imagine a mobile worker is filling out the first form that you mentioned, which we will call F1. The worker puts in all the information to your various normal questions. Great.

-- However, let's pretend that just before the end of your form, you have a hidden value field that chooses a random number from 1 to 100 inclusive. Also in that form you have a second hidden value called "yes-refer-to-form-2." That hidden value has an IF statement that will be "1" if the random number was less than 6.

-- The very last item in your form will actually be of type multiple choice.    It will have its display logic so that it will only display this label if the "yes refer to form 2" is "1".   This label will say "NOTE! THIS CLIENT HAS BEEN RANDOMLY CHOSEN TO BE REFERRED TO FORM 2.  THEREFORE, AFTER THIS FORM CLOSES, YOU MUST OPEN FORM 2, CHOOSE THIS CLIENT'S NAME, AND COMPLETE FORM 2 FOR THIS CLIENT."  

-- You make sure to configure the case management for Form #1 so that, under Child Cases, it opens a case of type "secondformcasetype" only if the answer to "yes-refer-to-form-2" is "1".   it should use the case management entries to pass any important fields that you want to be handed off and appear identically in form 1 and form 2.

-- then you design "Form 2" but you specify that it "updates or closes a case."  It is updating the case "secondformcasetype."   Therefore, when the mobile worker goes to open form 2, they are first presented with a list of cases that have been created of that type. They will see the names (or whichever field you specified) of the specifically chosen respondents, and they will have to choose which person they are completing it for. If all has gone right, there should only be one name waiting there anyway.   They fill out form 2, with its various questions you created there. AND, lastly, you configure its case management to CLOSE that case when the form is completed, so the name won't remain in that list permanently (and create the possibility of someone mistakenly filling out a second or third "form 2" for them.

Eric

Eric Stephan

unread,
Jun 27, 2016, 2:33:45 AM6/27/16
to commcare-users

Also, about 1000X simpler.   Is it simply that you want a bunch of additional questions to be asked of those specially chosen people?  Then much easier than setting up the case management... why not simply place all the additional "form 2" questions into the end of form 1... and simply make the visibility of each of that second set of questions be dependent on that "yes-refer-to-form-2" field.   Sure, form 2 answers would be embedded in the data alongside form 1, but can't imagine that's a problem. And if you truly wanted them separate, you could make a separate data export that only contained the "form 2" questions that are within Form 1 data...
Reply all
Reply to author
Forward
0 new messages