Variable Types

In a general legal document one may need to use quite different types of data and take different type of actions. For example, one may need to:

  • introduce a simple name,
  • include a long chunk of text,
  • populate a list or a table,
  • select an State or County from a closed list of possible values,
  • introduce a date,
  • remove part of the content depending on a certain condition (married or single, with kids or without them, citizen or foreigner, etcetera).
  • merge an addendum or schedule depending of a particular property defined by the user (a particular State, gender, civil status, etcetera)

And docusuit_ should be “smart enough” to generate the corresponding web form and handle all those subtleties whenever the final document is generated.

All of this implies that the variable tagging should be flexible enough to accommodate all those cases and simple enough so that “simple things are being kept simple”.

Let us give you a tour by the different available options:

Independent variables

These are the simplest, although they will be enough in the majority of cases, and they come in four different flavors that are determined by these different prefixes:

  • TEXT: for ordinary plain text.
  • TEXTAREA: multiline or HTML text.
  • SELECT: corresponding to closed lists of options that in the web interface could be shown as dropdown menus, radio buttons, check button groups, …
  • DATE: date fields.

A very simple example of use could correspond to something like this:

                                            Dear $TEXT_Name$,
                                            You should send us before $DATE_DocDate$ the statement corresponding to the county of $SELECT_County$ including your opinion:
                                            $TEXTAREA_opinion$$.
                                        

As before the TEXT and DATE prefixes correspond to an standard input field and a datepicker in the associated web form, while SELECT will generate a dropdown menu (how that dropdown may be populated is explained in here) and TEXTAREA will be associated to a standard rich text (or WYSIWYG) editor.

Hidden variables

There is a special type of independent variables corresponding to hidden variables in the associated web form.

These variable are tagged as $HIDDEN_variableName$ and they correspond to variables that are not visible to the user that fulfill the web form but are nonetheless necessary to complete the final document.

A possible example of use is when we know the filling the form because it has already been authenticated form and we want that the final document to be partially filled with its personal data that is stored in the SESSION variables of the website or in a cookie.

Grouped variables

It is quite often that a legal document to have tables and lists that should be populated by the user. i.e. a list of properties or a table that includes the name of children with their respective ages.

docusuit_ include specific type of variables to deal with this kind of need.

They have the structure:

  • $ROW_groupname_VARIABLETYPE_variablename$ or
  • $LIST_groupname_VARIABLETYPE_variablename$

Let us start by an example of use. Imagine that our Word template includes a table that we want to populate with an, a priori, indefinite number of rows. We may tag it as follows:

  • ITEM: $ROW_Invoice_SELECT_Item$
  • PRICE: $ROW_Invoice_TEXT_Price$

Let us go over the details:

  • The first prefix ROW instructs docusuit_ about the fact that this variable belongs to a set of variables that are grouped in a table row.
  • The second prefix, in this case “Invoice”, is just our personal name of choice to identify that particular group (in the document there may be another tables that should also be populated by the final user).
  • The third prefix is the TYPE of variables that we are going to use (TEXT, TEXTAREA, SELECT or DATE as explained in the previous section).
  • The last piece is the name we give to each individual variable. WARNING: this name should be unique, i.e. it can not be used in other variables, even if they belong or not to different groups.

In the case of lists a simple example would be:

  • $LIST_Catalog_SELECT_Item$

That shares in an obvious way the same structure that before.

In both cases docusuit_ will generate a “web form group” that could be iterated with the help of Javascript to let the final user to introduce as many elements as desired (standard input for price and a dropdown menu, for example, for the items in the catalog):

docusuit_ - Web form group

docusuit_ - Web form group

Logical Group variables

The logical group variables are designed to enclose parts of a Word document so they can be logically recognized by the docusuit_ parser.

There are two types of logical groups that are marked up with the following prefixes:

  • BLOCK: set of elements and/or chunk of a Word template which may appear or not depending on the value of another variable.
  • TAB: set of variables that should be grouped under a tab in the associated web form (only for display properties).

Both these logical group variables enclose “chunks of the template” so they should be written at the beginning and end of the logical group.

Let us first consider a simple example for the use of a BLOCK type variable.

We may ask the user fulfilling the web form if he is married (by, for example, ticking in a checkbox) and if so prompt him to fill in his spouse name. like in this case there is a part of the final document that may appear or not depending of his answer we should mark the Word template as follows:

                                            ...end of a previous paragraph.
                                            $BLOCK_Spouse$
                                            This is some text that talks about a possible spouse and that may disappear from the final document if the final users choose “single” in the corresponding web form input element. This block may contain its own variables like the name of the spouse: $TEXT_spousename$.
                                            $BLOCK_Spouse$
                                            Beginning of next paragraph...
                                        

As you may see from the previous example there are two paragraphs of text that should only appear if the “undersigner” of the document is married. Notice that this block itself contains a further variable corresponding to the name of the spouse. There is a priori no limit in the number of variables , groups or even blocks (as long as they are correctly nested) that may be contained by a given BLOCK.

Another example of logical group is given by the variables with prefix TAB.

An example of use may be given by:

                                            $TAB_finance$
                                            All the variables, if any, between this two TAB variables will appear under the same tab in the corresponding web form:
                                            $TEXT_money$
                                            $DATE_mydate$
                                            And that´s it.
                                            $TAB_finance$
                                        

This “TAB_finance” variable instructs docusuit_ of the fact that all the variables included between its first and second appearance should be grouped under the same tab (temporarily tagged as finance) in the corresponding web form.

Auxiliary variables

The purpose of this variable is to help to organize the info in the resulting web form and/or the final document.

By the time being there are three types:

  • HEADING: that will include a heading in the final web form…this is, of course, optional or can be done directly in the docusuit_ web interface ($HEADING_myTitle$).
  • COMMENT: to include a comment in the associated web form (optional again).
  • NUMBERING: to include autoincremental variables in the Word document.