D - 1/28, Vasant Vihar New Delhi - 110057, India www.dimagi.com Tel: +91 11-46704670 CommCare Form Builder 1 D - 1/28, Vasant Vihar New Delhi - 110057, India www.dimagi.com Tel: +91 11-46704670 1. Question Types TEXT QUESTION. Free form text entry LABEL. Used to display text or images only e.g. a counseling message. No input required. MULTIPLE CHOICE (SINGLE ANSWER): A question with multiple choices where only one choice can be selected MULTIPLE CHOICE (MULTIPLE ANSWER): A question with multiple choices where one or more choice can be selected INTEGER: A whole number. If a 0 is entered as the first digit, the 0 will not be stored. PHONE NUMBER/NUMERIC ID: any identifying number can be entered, including those starting with a 0 DECIMAL any decimal number can be entered DATE: For any date question, shows up in calendar format TIME: Any time question DATE AND TIME: Any date and time question together GROUP: This type of question is a container for other questions. Questions added within a 'group' will appear within a given section header. REPEAT GROUP: (Advanced) IMAGE CAPTURE: Capture an image/photo (Android only) AUDIO CAPTURE: Capture an audio recording (Android only). VIDEO CAPTURE: Capture a video recording (Android only) GPS: get a GPS reading BARCODE SCAN: activates a barcode scanner to capture information (must be separately installed) PASSWORD: Text question, where the characters you enter are displayed as '*' 2 D - 1/28, Vasant Vihar New Delhi - 110057, India www.dimagi.com Tel: +91 11-46704670 2. Question Required? If you check this box it will make the question mandatory - a user will not be able to skip it without providing an answer. They will get an error message stating that they must answer the question. 3. Display Condition This is the space for introducing basic skip logic- when do you want a question to show and when it should not show. Click “edit” to access the “Expression Editor”. For the display condition section you are stating the conditions under which you want the question to be displayed (NOT the situation in which it should skip). For example, consider a question that asks for a cellphone number. We only want to show that question if the answer to the previous question ("Do you have a cellphone?") is yes. 1. Once in the expression editor click "add expression" 2. From the question tree, drag the "Do you have a cellphone?" question over to the first box until the mouse shows a green check mark- then drop it in. 3. Grab the "yes" answer from the "Do you have a cellphone?" question and drag that into the second box. 4. Make sure that the drop down menu between the boxes says "is equal to." 5. Verify that a green "OK" box appears at the end of the expression 6. Click "save to form"- you will see the expression now appears in the box next to "skip condition" Now this question will only show when the answer to "Do you have a cellphone?" is "Yes." 3 D - 1/28, Vasant Vihar New Delhi - 110057, India www.dimagi.com Tel: +91 11-46704670 4. Validation Condition You can minimize errors and ensure consistency by putting constraints in "Validate Condition" on the types of answers your users can submit. Sticking with the cellphone question, we may know that the cellphone number should be 10 digits long. So we can add a constraint that forces users to provide a 10 digit number. 1. Once again, open the expression editor in "Validate Condition" by clicking "edit" 2. Click "add expression" 3. Drag the same question you are working on ("What is your cellphone number?") from the question tree over to the first box. You should see a "." appear. 4. Set the drop-down menu to "is less than" 5. In the second box, type 10000000000 (11 digits) 6. Repeat 2-5 using the expression "is greater than" and the value 99999999 (8 digits) You will have written two expressions and can save these to the form. Back in "Logic Properties" you can also write a "constraint message" that let's the user know about the constraint. For example, in this situation the message could read "cellphone numbers must be 10 digits." You can put this in each language, and click on "Constraint Itext ID" to automatically generate an ID for this message. 4 D - 1/28, Vasant Vihar New Delhi - 110057, India www.dimagi.com Tel: +91 11-46704670 5. Hidden Value A Hidden Value is used for complex calculations, amongst other things. For example, let’s say you have a question asking for a person’s weight and a question asking for a person’s height, and you want CommCare to calculate the person’s BMI (= weight / height 2). This is how you do it: 1. You create a hidden value with Question ID “bmi_hidden_value”. 2. In the Calculate Condition box, click “Edit” to access the Expression Editor 3. Check the box for “Advanced Mode” 4. In Advanced Mode, you can drag the height and weight questions into the Expression Box and use these references to do calculations. 5. After creating the proper expression, click “Save to Form” and the bmi_hidden_value will now contain the person’s calculated BMI. 6. Translations If you want your application to be in multiple languages, 1. 2. 3. 4. Go to the Languages section in the left side menu. Click “+ Add Language” and type your language code (hin for Hindi, mar for Marathi) Click Save. Now the all the module and form names will need to be updated in both languages. For every given question, there will now be two parts where you fill in the display text – one for the display text in English and one for the display text in your second language. 5