Articles in this section

How to filter the answers for dropdowns or flexible dropdowns

This article explains how to narrow down the list of possible answers based on other dropdown or flexible dropdown questions from the response form or based on User Profile fields. 

  Prerequisites

  • Library and at least one Dynamics module enabled.
  • Templafy Desktop and Office VSTO add-in installed.
  • Space owner access to the Templafy tenant.
  • The dropdown question must be eligible for filtering (either another dropdown or a User Profile dropdown field can be used to filter the dropdown).

How does filtering work? 

Sometimes, when building the response form, Dropdown or Flexible dropdown questions might require to filter one another to narrow down the possible answers for the end-users. In order to filter questions, all the possible answers must be linked to the same data source and be set up as reference schema fields. A Dropdown or Flexible dropdown question can be filtered by more than one field if they are related to one another. 

How to filter a dropdown or flexible dropdown

Filtering a Dropdown or Flexible dropdown question can be done following the steps below:

  1. In Template Designer, open the Form tab.
  2. Click + Add question.
  3. In the Type field select Dropdown or Flexible dropdown.
  4. In Question title type the question. This is the question that will be displayed to the end-user.
  5. Select the Data source containing the list of answers necessary for the question.
  6. Select the Label column of the data source that should be displayed to end-users when answering the question.
  7. Click on Filter options.

      Note

    • This section will only be displayed if the dropdown is eligible for filtering.
    • Filter options are only available to Dropdown and Flexible dropdown questions. Data connector questions cannot be filtered.
  8. Click + Add filter.
  9. Select the form field or User Profile field that should be used as a filter.
  10. Repeat steps 8 and 9 to add additional filters if necessary.
  11. Click Add to form (or click Save if you edited an existing question).

  Note

If there is only one answer left in the final filtered dropdown, it is possible to hide the question from the response form as no additional interaction is required by the end-user.

  Important

  • The filter option only appears if the question created can be filtered either by a User Profile field or by another question from the response form.
  • When both parent questions are Dropdowns, the child question will display the filtered answer and the child answer will update if the parent answer changes. 
  • When both parent questions are Flexible dropdowns, the child question will not display any answer. 
  • When the parent question is a Dropdown and the child question is a Flexible dropdown, the child question will display the filtered answer, but the child answer will not update if the parent answer changes.
  • When the parent question is a Flexible dropdown and the child question is a Dropdown, the child question will be greyed out as this use case is not supported.
  • Be careful when you edit fields that are used for filtering other fields, because this requires modification of the filters itself to prevent validation errors when you upload the template to the Admin Center.
    When you change the data source of a field that is used for filtering, then edit the field that contains the filter and delete the current filter(s). Then apply the filter(s) again and save the field.

Examples

Example using a single filter

In this example the Products data source is used. The Category column has a reference to the Categories data source:

productsschema.png

The data sources contain the values below:

referenceddatasourcecategories.png

  1. On the Form tab create a Dropdown with the Question title 'Category'.
  2. Link the field to the Name column of the Categories data source and select 'Fruits' as default value. The result looks like this:
    dropdowncategory.png
  3. Click Add to form.
  4. Create a second Dropdown with the Question title 'Product'.
  5. Link the field to the Name column of the Products data source.
  6. Click + Add filter. In the Filter by field select 'Category'.

      Note

    It can occur that the Filter by field shows multiple fields with the same name.

    Make sure to select the correct field, in this case the 'Category' Form field and not the User Profile field:

    categoryformanduserprofile.png

  7. The result looks like this:
    dropdownproduct.png
  8. Click Add to form.
  9. The Form tab now shows the questions that have been created. Click Preview form to see how the questions will appear to the end-user:
    categoryandproductfields.png
  10. By default 'Fruits' is selected as Category. So the Product dropdown only shows fruits. When the category is changed to 'Vegetables', then the Product dropdown only shows vegetables:
    fruitsandvegetables.gif

      Note

    When no category is selected (the field can be cleared by clicking the x), then the Product dropdown will show both fruits and vegetables.

Example using multiple filters

In this example the same Products data source is used as in the previous example, but with an additional reference. The Category column has a reference to the Categories data source and the Origin column has a reference to the DomesticImport data source:

datasourceproductsschema.png

The data sources contain the values below:

referenceddatasources.png

  1. On the Form tab create a Dropdown with the Question title 'Category'.
  2. Link the field to the Name column of the Categories data source. The result looks like this:
    dropdownfieldcategory.png
  3. Click Add to form.
  4. Create a second Dropdown with the Question title 'Origin'.
  5. Link the field to the Name column of the DomesticImport data source. The result looks like this:
    dropdownorigin.png
  6. Click Add to form.
  7. Create a third Dropdown with the Question title 'Product'.
  8. Link the field to the Name column of the Products data source.
  9. Click + Add filter. In the Filter by field select 'Category'.
  10. Click + Add filter again to add a second filter. In the Filter by field select 'Origin'. The result looks like this:
    dropdownproductwithfilters.png
  11. Click Add to form.
  12. The Form tab now shows the questions that have been created:
    categoryoriginproductfields.png
  13. Click Preview form to see how the questions will appear to the end-user:
    multifilter.gif

    Depending on the selected category and/or origin these are the results:
    Category Origin Product
    Empty Empty All products
    Empty Domestic All domestic products
    Empty Import All import products
    Fruits Empty All fruits
    Fruits Domestic All domestic fruits
    Fruits Import All import fruits
    Vegetables Empty All vegetables
    Vegetables Domestic All domestic vegetables
    Vegetables Import All import vegetables

 

slides sharepoint settings template designer smart fields show question show form field a malformed uri was found in the document tech_role
Was this article helpful?
0 out of 1 found this helpful

Comments

0 comments

Article is closed for comments.