For created templates, you need to set a connection between the template field and a data source field, which is called mapping. Mapping will be used to fill in PDF fields with table or view fields data when an app user downloads a file. 

The Mapping tab of a template view showing the data source and the list of fields that can be mapped.

Steps to map a template with a table or view:

    1. In a template, on the Mapping tab, from the Data source field, select the table or the view to which you want to map this template.
    2. If the table that you selected has relationships with other tables, in the Related tables field, choose whether you want to map document template fields with fields from related tables:

      Note: You cannot use both related tables and the Use display value option in the same mapping configuration. If you select related tables, the display value option will not be available.

      1. Click the Edit icon. 
      2. In the Related tables panel, in the Tables section, click the Add icon and select the related tables that you want to use for mapping or select All tables.
      3. If the table that is the main data source for mapping has more than one relationship with the related table that you selected, in the Relationship list, select the relationship that you want to use to get the records.

        The Related tables pane showing two relationships to choose from.
      4. Optional: For related tables that have a one-to-many relationship with the main data source table, in the Sort by fields section, click the Add icon, select the fields by which you want to sort the values, and then arrange the sorting order.
        Sorting helps you make sure which records from related tables are returned first, which gives you greater control of the values that are used in the generated PDF document.
        The Related tables pane showing options for configuring sorting fields.

      5. Click Apply.
    3. Confirm your settings by clicking Save.

    Now you can map document template fields to specific fields in your data source: