How to use a data source multiple times in the same template

Map data elements in the configuration to use the same data source multiple times in the same template

 

Use case:

You keep one data source of States / Abbreviations but you need to use it for Plaintiff / Defendant / Attorney.

 

 

Solution:

 

Map a data source for each of the Plaintiff / Defendant / Attorney, to the same database, and create a template. A snippet for the template would look something like this. We will make tweaks to it as we move along this article:

Plaintiff:
«Plaintiff_name»
«ChooseFromDataSource(PlaintiffState,Select the state of the Plaintiff?,RefreshNoSave,,AllowSearch)»
«State»


Defendant:
«Defendant_name»
«ChooseFromDataSource(DefendantState,Select the state of the Defendant?,RefreshNoSave,,AllowSearch)»
«State»


Attorney:
«Attorney_name»
«ChooseFromDataSource(AttorneyState,Select the state of the Attorney?,RefreshNoSave,,AllowSearch)»
«State»

 

Connect to database with XpressDox templates document automation precedents

 

In their current state, all data sources will be using the same data elements. Consider the XML data set for the data source “PlaintiffState”:

<xml>
<State>Alabama</State>
<StateCode>AL</StateCode>
<County>aa</County>
<XDNewDataPlaintiffState></XDNewDataPlaintiffState>
</xml>

 

compared to the XML data set for the data source “DefendantState”:

 

<xml>
<State>Alabama</State>
<StateCode>AL</StateCode>
<County>aa</County>
<XDNewDataDefendantState></XDNewDataDefendantState>
</xml>

 

The only difference here is the name of the data source, but the data elements that the first data source returns would populate all the “States” in our sample template pictured above. To get around this, map the data element names in the configuration in order to give each of the data sources their own set of unique data element names.

 

Connect to database with XpressDox templates document automation precedents

 

Click “Add prefix to all names” and give this data source an appropriate prefix.

Connect to database with XpressDox templates document automation precedents

 

Note the data elements in this data source has been prefixed.

Connect to database with XpressDox templates document automation precedents

 

Testing the data source now would reveal different XML:

<xml>
<PltfState>Alabama</PltfState>
<PltfStateCode>AL</PltfStateCode>
<PltfCounty>aa</PltfCounty>
<XDNewDataPlaintiffState></XDNewDataPlaintiffState>
</xml>

 

 

<xml>
<DefState>Alabama</DefState>
<DefStateCode>AL</DefStateCode>
<DefCounty>aa</DefCounty>
<XDNewDataDefendantState></XDNewDataDefendantState>
</xml>

 

The template can now be changed to the following:

Plaintiff:
«Plaintiff_name»
«ChooseFromDataSource(PlaintiffState,Select the state of the Plaintiff?,RefreshNoSave,,AllowSearch)»
«PltfState»


Defendant:
«Defendant_name»
«ChooseFromDataSource(DefendantState,Select the state of the Defendant?,RefreshNoSave,,AllowSearch)»
«DefState»


Attorney:
«Attorney_name»
«ChooseFromDataSource(AttorneyState,Select the state of the Attorney?,RefreshNoSave,,AllowSearch)»
«AttState»