Articles in this section

How to insert different values by selecting one option from a dropdown

This article explains how you can use a dropdown field and a data source to insert different values in a document by selecting one option from the dropdown.  

  Prerequisites

  • Library and at least one Dynamics modules enabled.
  • Templafy Desktop and Office VSTO add-in installed on the PC.
  • Space owner access to the Templafy tenant.
  • At least one data source is set up.

Example of insertion of different values by selecting one option

In this example we use a dropdown field to select the gender of a contact person. Based on the selected option 'Male' or 'Female', the variables mr/mrs, he/she, him/her and his/her will be shown in the document.

The first step is to create a data source 'Gender' with the schema fields MrMrs, HeShe, HimHer and HisHer. In this data source we add two items with the Name 'Male' or 'Female'.  The data source with the items looks like this:

MultipleVariables_DataSourceGender.pngThe second step is to create a document with at least one dropdown field by following the instructions below:

  1. In Word open a new document, then in Template Designer click + Create template.
  2. In Template Designer, navigate to the Form tab and click + Add question, then in the Type field select Dropdown
  3. Enter the Question title 'Gender'.
  4. Select the Data source 'Gender'.
  5. Select the Label column 'Name'.
  6. Click Add to form.

The dropdown properties look like this:

FormDropdown_ExampleGender.png

The last step is to insert the different values in the document by following the instructions below:

  1. In Template Designer, navigate to the Template tab.
  2. Select the location where the smart field should be inserted.
  3. Click Add smart field.
    This step doesn't apply if you are adding the very first smart field in the template.
  4. Click Form responses.
    Select 'Gender' and expand this form to show all the variables. Select the variable you want to insert, e.g. 'HeShe'.
    MultipleVariables_SmartFieldGender.png
  5. Click Add to template.
  6. Repeat steps 2 to 5 to insert all the values of the 'Gender' data source you want to insert in your document. When you are done, the document looks like this:
    MultipleVariables_Template.png

When creating a document, a user can select the gender from the dropdown. The document will show the values for the selected option. The result looks like this:

MultipleVariables_FemaleMaleUpdate.gif

Salesforce custom xml best practices custom document property compile connector create template cookie chrome custom inline binding tech_role
Was this article helpful?
0 out of 0 found this helpful

Comments

0 comments

Article is closed for comments.