Show and Hide Questions

Learning Objectives

After completing this tutorial, you’ll be able to:

  • Add and Edit Questions to contain dependent logic

Prerequisites: Build Your First Form Template

Time Required: 10 Minutes


Branching Logic

Youreka offers the ability to show and hide questions based on previous inputs. In some cases, questions need to follow a flow of logic, prompting intelligent follow up to ask the right question at the right time. For instance, when filling out a healthcare form, there may be follow-up questions that a healthcare provider would want to ask if the patient identifies as a smoker that would not apply to non-smokers. These might include: “How often do you smoke?” or “Is there a history of lung cancer in your family?”.

Youreka allows the user to easily control the flow of question logic in their form right from the template builder. This tutorial will demonstrate how to make questions dependent on other question inputs. We will continue to build upon Arabica Coffee Co.’s store visit use case, and alter questions in the form template to become dependent on other inputs. This will save the Arabica sales rep time in the field by avoiding unnecessary data capture during the visit.

Add Branching Logic to your Template
  1. Log in to Salesforce.
  2. Once logged in, navigate to the App List and select Youreka.
  3. Navigate to the first template we created in our opening exercise by clicking the Form Templates tab to open your library of templates. Select your template by clicking on the Form Template Name (Arabica Coffee Store Visit).form templates salesforce youreka
  4. The Form Template Detail Page will likely have the form you created in the First Form Template tutorial depending on your stage in the tutorials. We must delete any associated forms before we can continue making edits to the template. Click Delete under Forms Action.arabica youreka coffee store visit
  5. Now click the Edit Button to launch the Template Builder and make changes to the Form Template.
  6. In the Store Contact Information Section, we want to add some dependencies based on the Store Manager’s preferred contact method. Drag and Drop a new question into the Store Contact Information section above the existing Phone Number question. Name this new question Preferred Contact Method, with the field type Picklist.
    1. Question text should be Preferred Contact Method.
    2. Set field type to Picklist.
    3. Option 1 in our picklist will be Phone
    4. Option 2 will be Email
    5. Leave all other options as the default
    6. Click Save

Display Logic Preferred Contact.jpg

Display Logic Tab
  1. Now we are going to modify the existing Phone and Email questions to ONLY display when the preferred contact method is selected.
    1. Select and edit the Phone Number question by clicking the pencil icon to the left of the question. This opens the Question Edit box where we will select the Display Logic tab next to Question Details. Change the Viewable picklist option from Always to Conditional Visibility. This gives us the ability to start customizing our dependent logic in the form.
    2. Set In Section to Store Contact Information. In the middle picklist, set …When the Question… to Preferred Contact Method and in …Has the Following Value(s): check Phone.
    3. We have now set the logic on our question to ONLY appear if a form filler selects ‘Phone’ from the picklist in the Preferred Contact Method question.
    4. Click Save.Display Logic Phone.jpg
  2. Repeat step #7 for the Email field, setting the Value to Email for Preferred Contact Method.
  3. When all fields have been updated, click Save and then Preview your form. You should see your changes have been saved and you can test your dependent logic right from the Preview page. Under Preferred Contact Method, select ‘Phone’. If the exercise was completed correctly, this will cause the Phone question to appear. Perform the same test with Email.DL Preview.jpg
  4. There are other areas in the Arabica Store Visit form where we can add dependent logic. In the General Information Section, we can adjust the “What Types of Coffee Snacks are Available?”“Specify Other” and “Where is the Display Real Estate located?” to all be based on inputs from previous questions. Edit the ‘Which Coffee Snacks are Available?’ question by clicking the pencil icon.
    1. Click the Display Logic Tab.
    2. Set Viewable to Conditional Visibility.
    3. Set parameters to General Information Section > Which of the following complementary coffee products are available? > Coffee Snacks.
    4. Click Save.DL Coffee Snacks.jpg
  5. Edit the Specify Other question by clicking the pencil icon.
    1. Click the Display Logic Tab.
    2. Set Viewable to Conditional Visibility.
    3. Set parameters to General Information Section > What types of Coffee Snacks are available? > Other.
    4. Click Save.DL Other.jpg**Note: Youreka can support multiple levels of dependencies as demonstrated here. This question will only appear if it meets two previous requirements: Which of the following complementary coffee products are available? = Coffee Snacks, and Which coffee snacks are available? = Other. Youreka supports potentially infinite levels of dependencies and even offers users the ability to use AND/OR logic when multiple checkbox values are selected.
  6. Edit the Where is the Display Real Estate Located question by clicking the pencil icon.
    1. Click the Display Logic Tab.
    2. Set Viewable to Conditional Visibility.
    3. Set parameters to General Information Section > Is there Display Real Estate Available? > Yes.
    4. Click Saveedit question display logic youreka
  1. Preview your template and notice that this section has shrunk to only three questions. As you start to make inputs, the corresponding questions will appear, prompting more follow-up based on those inputs.coffee filters option youreka form
  2. Save your form and click Close to return to the Form Template Detail page.

 

You’ve got the hang of it now! Before we finish, take note of one last feature that will help you stay organized as you build conditional display logic into your forms.


View Dependent Question Logic

We have many customers who have built forms with sometimes hundreds of questions, with extremely complex display logic. With so many branches, building complicated forms can be tough. However, with the Dependent Question Logic visualization feature, you can view your form template as a tree, displaying all of the various paths that users can take through the form.

To view your form logic, visit the Form Template Detail page and select “View Dependent Question Logic” from the dropdown menu.

Select Review Logic.jpg

From here, you’ll be taken to a canvas that displays all of your questions with their various dependencies.

Review Logic.jpg

Add multiple pages to your forms! Learn how with the Page Breaks Tutorial.

We use cookies to ensure that we give you the best experience on our website.
If you continue to use this site we will assume that you are happy with it.