Using One Template to Produce Multiple Documents Within One App

If we wanted to produce a will for both a client and a spouse, we are able to do so within one app. Where we upload a template to determines how it can be used. Templates inside a catalog cannot easily be re-used; however, a template on a model can be used and obtain information specific to each object.

We will walk through the example of creating a will for both a client and spouse:

  1. Navigate to the party model. Select the Templates tab and upload the Will docx template. Save.

    Note: We will use variables within the current model. In this example, we will use variables from within the party model. For example, instead of Client.FullName, we use FullName. This is because Client.FullName is in the catalog and not the current party model.

  2. Navigate to the catalog. If you do not already have Client or Spouse object variables, create them now. The model they are based on is the party model.
  3. Add Will to the table in the SelectDocs list of selection variable. You can read more in Using Multiple Templates Within One App on how to do this.
  4. Add a new variable single selection variable, CreateDocsFor. Add the options to create this template to the Options defined below table: Client, Spouse, and Both.

  5. Select the Apps tab. We are adding the Will template to the Documents app. We will add conditional logic to the App Template:

    Note: We have added an additional check—MarriedTF a true/false variable.

{[if (SelectDocs|contains:
"Will")]}
{[if
!MarriedTF || (MarriedTF && (CreateDocsFor == "Client" ||
CreateDocsFor == "Both"))]}
    {[Client.WillTemplate]}
{[endif]}

{[if MarriedTF
&& (CreateDocsFor == "Spouse" || CreateDocsFor ==
"Both")]}
    {[Spouse.WillTemplate]}
{[endif]}
{[endif]}

Note: The above logic means that if the Client is married, then the CreateDocsFor question will ask if the Will needed to be created for the client, spouse, or both. The Will will create for the Client if the client is not married or the client is married and it has been selected to create the Will for either the client or both.

The Will will create for the Spouse if the client is married and either spouse or both have been selected.

  1. Run the Documents app.

Adding Variables in a Template on a Model

Now that we have a template inside of the party model, we may want to include variables that are not within the party model to complete the template design. To do this, we create formulas within party to bring in the other variables depending on whether the template is for the client or spouse.

An example of this is if we have multiple will types and these could be created for either the client or spouse. In the catalog we create two variables for will type selections: ClientWillType and SpouseWillType.

Now, we navigate to the party model and create the following PartyWillType text formula:

id$ == Client.id$
     ? ClientWillType.Name
     : MarriedTF && id$ == Spouse.id$
          ? SpouseWillType.Name
          : null

Note: To learn more about what each symbol in this expression means, view the Formula Reference article.

id$ in this instance determines which iteration of party you are currently in (either Spouse or Client; i.e. if id$ == Client.id$ then it is using the Client object variable).

In some cases, the Will related variables may not all be together. We could place the WillType variable on a will model instead, and then in the catalog, have both ClientWill and SpouseWill object variables. This would change the formula PartyWillType to:

id$ == Client.id$
     ? ClientWill.WillType.Name
     : MarriedTF && id$ == Spouse.id$
          ? SpouseWill.WillType.Name
          : null

We could take this a step further and create a mirroring variable called SpouseWillMirrorTF. This true/false variable's question prompt would be: "Is the spouse's will using the same options as the client's will?" If yes, then the client's will variables will answer the same questions for the spouse's will. To do this, we add another condition to the PartyTypeWill:

id$ == Client.id$
     ? ClientWill.WillType.Name
     : MarriedTF && id$ ==
          Spouse.id$
          ? SpouseWillMirrorTF
               : ClientWill.WillType.Name
               : SpouseWill.WillType.Name
          : null

Did this answer your question? Thanks for the feedback There was a problem submitting your feedback. Please try again later.

Still need help? Contact Us Contact Us