What are Merge Document Variables?

What are Merge Document Variables?

Merge Documents Variables

Merging documents is one of the most important functions in STAC, and the variables are the engine that powers the merge.

There are hundreds of variables available in STAC that list virtually any field stored in the database. There are variable that prints events, relationships, charges, sentences, etc, and the variables are organized by the Variable Type which closely correlates with the different areas in STAC.

Since each agency can create it’s codes to track events, relationships, images, etc, it can also create variables to print the data stored in these areas. For example, if a user creates a new Relationship code to track a new party related to a case, they can also create variables to output data about this relationship.

As we mentioned before, except for some motions and a few other documents that require attorneys to type specific facts about a case, every document should be 100% ready. After the merge the users should not have to make a single correction. Any document that requires updating after every merge is a strong indication of bad data quality or the use of an incorrect variable.

There is one type of variable that displays a field where the user merging the document can type a text that will be merged into the document. This variable should be rarely used! There are situations where data is needed in a document that may not be stored in the database, and that is the reason this variable was created. However, this variable should not be used in place of collecting the data in the case and merging it.

The first five fields in the Variable Add/Edit screen are the most important. The variable should clearly reflect the output of the variable. Once a variable is created it should never be renamed after it’s added to a document template because renaming a variable will break any document that uses that variable. Users can change the properties of a variable without breaking the document, but renaming a variable will result in documents not merging properly. The Variable Type and Variable Column fields are where users can define what the variable does. The fourth and fifth fields are where users define the codes that this variable will be looking for. For example, to print the date of the next hearing, users would choose Next Event for the type, Date for the column, and Hearing for the code.

This module will discuss the different types of variables that can be used with merged documents.


Incident Variable:

Variable TypeDescription
INCIDENTFields related to a case. In addition to the case number, county, and other fields, this category includes fields that list the SA or PD name, clerk name, etc.

Incident variables return fields from the incident table, like Case number, Clerk number, County, Case Type, and Trial Location, etc. Additionally, this variable returns values associated with the fields associated with the case, like the address for each location, name of the Elected Official, and others

Variable Columnvalue or where it can be set
ADDRESSOffice address set in the location code table
CASE_NUMERIC_PORTIONNumeric portion of a case without leading zeros
CASE_SUB_TYPE
CASE_TYPE
CASE_YEAR
CIRCUIT OR COUNTYCircuit or County based on the court type code table
CITYOffice city set in the location code table
CLERK
CLERK_NUMERIC_PORTIONNumeric portion of Clerk# without leading zeros
CLERK_TYPE
CLERK_YEAR
COMMENT
COUNTY
COUNTY CHIEF ASSISTANTThis value is set in the county code table
COUNTY CIRCUIT NAMEThis value is set in the county code table
COUNTY CIRCUIT NUMBERThis value is set in the county code table
COUNTY CLERKThis value is set in the county code table
COUNTY NAME 1This value is set in the county code table
COUNTY NAME 2This value is set in the county code table
COUNTY PUBLIC DEFENDERThis value is set in the county code table
COUNTY SHERIFFThis value is set in the county code table
COUNTY STATE ATTORNEYThis value is set in the county code table
COUNTY STATE ATTORNEY BADGEThis value is set in the county code table
COURT_TYPE
CRIME_LAB
CRIMINAL, TRAFFIC, JUVENILE
DEFENDANT_LETTER
DEPARTMENT
DEPARTMENT_PHONEThis value is set in the department code table
DIVISION PARALEGALThis value is set in the department division detail table
DIVISION PHONEThis value is set in the department division detail table
DIVISION SECRETARYThis value is set in the department division detail table
DIVISION SUPERVISORThis value is set in the department division detail table
EFILE_UCN
FILING_NO
GUIDELINE_DEPARTURE
INCIDENT_ID
INCIDENT_NO
INCIDENT_NO_PRINTABLECase# formatted with dashes if used in the mask
INCIDENT_TYPE
LOCATION
MAIL_ADDRESSOffice mailing address set in the location code table
MAIL_CITYOffice mailing city set in the location code table
MAIL_STATEOffice mailing state set in the location code table
MAIL_ZIPOffice mailing zip set in the location code table
MED_EXAMINER
NEW CLERK NUMBER
PHONE_1This value is set in the county location table
PHONE_2This value is set in the county location table
PHONE_3This value is set in the county location table
PHONE_4This value is set in the county location table
PHONE_COMMENT_1This value is set in the county location table
PHONE_COMMENT_2This value is set in the county location table
PHONE_COMMENT_3This value is set in the county location table
PHONE_COMMENT_4This value is set in the county location table
SENTENCE_GUIDELINE
SENTENCE_GUIDELINE_RANGE
SENTENCE_POINTS
SPECIAL_CODE_1
SPECIAL_CODE_2
SPECIAL_CODE_3
STANDARD CLERK
STATEOffice State set in the location code table
TRIAL LOCATION
VIOLENT_CRIME
ZIPOffice ZIP code set in the location code table

Relationship Variables:

Relationship variables return multiple datasets for the relationships listed in the case. There are multiple types of relationship variables, and the most important types are Relationship, Relationship list or selected, and relationship document. The additional types are also described in this section.

Relationship

Relationship variables are to be used with relationships that are unique in a case, like the judge, the prosecutor, the defense attorney, the defendant, etc. It will return only a single record regardless of how many relationships of that type there are in a single case. One of the most common mistakes is to use this type of variable to print victims. Since many cases have no victim or one victim, the variable works most of the time, but in cases with multiple victims, this variable will only print the first victim, and the document will be incorrect because of the missing victims. This variable type returns individual fields from the directory, address, and relationship tables, in addition to special fields where data is preformatted, like the name or address of a person

Relationship List and Relationship Selected

These two types are to be used with relationships that can be multiple in a case, like officers, victims, and witnesses. They return different lists with names, addresses, phone numbers, badge numbers, etc. These lists can be concatenated using different concatenation to render lists or paragraphs. The basic difference between Relationship List and Relationship Selected is that the list will merge all records matching the specified criteria to the document, while the relationship selected displays a list on the screen during the merge process to allow the operator to select or deselect names that will be merged into the document

Relationship Document

Relationship Document variables work exclusively with Relationship Documents. These variables do not require any additional settings because the document tells the variable which relationship should be printed. An easy way to understand this variable is to think of subpoenas. Subpoenas are generated for multiple relationships in a case and the selection of the person or entity being subpoenaed is made by the document. Relationships Document variables return the data about the individual or entity the document is processing.

TypeDescription
RELATIONSHIPRelationship in a case. This variable should be used exclusively for relationships that are unique to a case like a defendant, judge, or current attorney.
RELATIONSHIP DOCUMENTThis variable only works on Relationship Documents and list fields for the relationships selected during the merge process. For example, when merging subpoenas for multiple witnesses, this category of variables prints the data related to each selected relationship
RELATIONSHIP DOCUMENT EVENTLists of events data related to the directory selected on a Relationship type document. Allows printing events related to a selected relationship
RELATIONSHIP DOCUMENT EVENT LISTLists of events data related to the directory selected on a Relationship type document. Allows printing events related to a selected relationship. Prints list of events
RELATIONSHIP LISTList of relationships on case
RELATIONSHIP SELECTEDList of relationships on case
CASE RELATIONSHIP LISTLists relationships in consolidated cases.
CASE RELATIONSHIP SELECTEDLists relationships in consolidated cases.

Event Variables:

There are two basic types of event variables: Variables that print a single event and variables that print a list of events.

All Events can be FIRST, LAST, NEXT, AND PREVIOUS types print a single event. They return records based on the event date.

EVENT LIST and EVENT SELECT returns a list of events. The LIST automatically merges all matching records and the SELECTED displays a selection list on the screen

These variables can be defined using a combination of event type and/or event subtypes. The list and selected variables allow multiple events to be defined for the same list. The other variables allow one single event type and/or event subtype

TypeDescription
EVENT LISTList of events on a case
EVENT LIST FUTUREList of events on a case with a future date
EVENT LIST PASTList of events on a case with a date in the past
EVENT SELECTList of events on a case. The application displays a screen to allow users selecting the events that will be merged
EVENT SELECT FUTUREList of future events on a case. The application displays a screen to allow users selecting the events that will be merged
EVENT SELECT PASTList of past events on a case. The application displays a screen to allow users selecting the events that will be merged
FIRST EVENTFirst chronological event of a case regardless if the date is in the past or future
LAST EVENTLast chronological event of a case regardless if the date is in the past or future
NEXT EVENTNext chronological event of a case based on the date and time a document is merged
PREVIOUS EVENTLast chronological event of a case based on the date and time a document is merged

Charge Variables:

There are multiple types of variables for charges that return different lists of charges. Each list has multiple combinations of count number, statute number, charge description, level, and degree.

For State Attorneys, there is a very special type called Charge Merge. Charge Merge type has variables that merge the charging document. They performed a double merge by first merging the document for each statute and then merging all these documents into the Information. Another important difference with this group is that all variables in this group list all charges on multi-defendant cases when the cases are consolidated in STAC.

TypeDescription
CHARGE DISPOSEDList of the most recent disposed charges. They can the current set of charges if the case is closed or the charges disposed of in the previous sequence of charges if the case is still open
CHARGE FILEDList of the most recent filed charges
CHARGE FIRST COUNTFirst count of the most recent sequence of charges. This returns only the first count
CHARGE LISTList of the most recent sequence of charges. This is the most commonly used type
CHARGE MERGEVariable used to create the Information. Merges the text associated with each statute used on a case. The configurations associated to this process can be located in the Document Options code table
CHARGE NOT FILEDList charges in the previous sequence that are not listed in the current sequence
CHARGE ORIGINALList of the first sequence of charges
CHARGE SENTENCECharges that are related to a sentence
PRIMARY CHARGE LISTFirst sequence of charges on a case

Sentence Variables:

The sentence variable lists the records listed in the sentence tab. There are many variables in the type to allow listing sentences either as a list or a paragraph. In addition to using the List Concatenator when defining the variable, there are additional settings in the Amount Type code table to allow print time, currency, and other amounts properly.
TypeDescription
SENTENCELists sentence record on a case

Email Variables:

Email variables were created to be used exclusively with the functions that can generate an email. All common variables are available to be used in emails, but when generating an email from the Image tab, for example, there are specific variables that are related to the image being email like the image type, subtype, date, etc. That is why these variables are broken into different types, and they are available on the Email Template screen based on the Email Category

TypeDescription
EMAILBasic fields for an email. I.E. recipient, office name, Email comment
EMAIL ASSIGNMENTEmail field related to an assignment. Used during the approval process
EMAIL DOCUMENTEmail field related to a Document. Used when emailing documents during the merge process
EMAIL EVENTEmail fields used on emails created upon adding an email
EMAIL IMAGEEmail fields for email created from the Image tab
EMAIL INVESTIGATION EVENTEmail fields for email created from the Investigation tab
EMAIL NOTEEmail fields for email created from the Notes tab
EMAIL REQUESTEmail fields used for the request module as requests are created and approved
EMAIL SUBPOENAEmails fields related to subpoenas. Used during the merge

Email variables return fields from the specific module they are referencing, like the Email Image Variable Type will give the users fields based on the Image tab. The fields include the code, comment, date, document, filename, image ID, etc.

Below, we can see the variable column options for the Variable Type Email Image.

Variable ColumnValue Description
CodeThe CODE section plays a crucial role in identifying and categorizing records. It consists of two key components:
Code Type: Denotes the primary code used for record identification, such as Event Type, Relationship, Diversion, etc.
Code Sub Type: Specifies the secondary subcode for further record identification. For example, when dealing with specific hearing types, the Code Sub Type might include hearing subtypes.
TIP: Not all variables require both Code Type and Code Sub Type
CommentThis pertains to the comment entered in the relevant comment field. It provides additional context or details regarding a specific record
DateRefers to the image date
DocumentThis section involves extracting information from the image subtype configuration table, specifically from sources like exchanges and the CIP Portal. To determine the image type and sub type, use the corresponding code and code sub type presented below the Variable Column
Image IDThe unique identification number assigned to an image when it is entered into the Image tab
Related NameIndicates the name associated with the image. In the Image tab, when adding or editing an image, the Name field can be activated to select a person from the case or directory linked to the image
Sub TypeIndicates the image subtype selected during the processing of the image
TypeIndicates the image type selected during the categorization process
Info
Additionally, users can use the following Select statement to see all of the variables and their coinciding information and source. The select statement below does NOT include the write your own variables! 
Select * from it_variable_list

Diversion Variables:

This variable type has different lists of diversion sanctions and diversion payments
TypeDescription
DIVERSIONList of diversions on a case
DIVERSION PAYMENTList of payments for a diversion on a case

Jury Instruction Variables:

For agencies that create Jury Instructions, these types of variables have columns that create the Jury Instruction documents. The Instructions must be previously set and be ready to be merged. 

Cost Variables:

These types contain multiple lists to merge costs associated with a case.
TypeDescription
COSTList costs associated with a case
COST PER CASE SELECTEDList costs associated with a case, but allow users to select records during the merge

Note Variables:

These types contain lists to merge notes associated with a case.
TypeDescription
NOTEList of notes on a case

Subpoena Select Future Variables:

TypeDescription
SUBPOENA SELECT FUTUREList subpoena fields for subpoenas that are scheduled for a future date

Code Select Variables:

The Code Select variable type is very helpful to create lists of items that can be merged into a document. A Subpoena Duces Tecum is a good example of this variable. Using the Discovery Code values to create a list of items a person could be required to produce. During the merge process, the system displays a list of possible required items and the operator can select the appropriate items to be merged. Another situation where this variable can be helpful is when paragraphs or phrases must be added to a document depending on the document or case.
TypeDescription
CODE SELECTDiscovery

Input Variables:

The Input and Case variables are identical in how they work. They present an input field for the operator to during the merge to allow keying data that will be merged in the document. This variable should be used AS LITTLE AS POSSIBLE.
 There are instances where the content to be merged in a document is not stored in the database, but the overuse of this variable is an indication that important data is not being captured, stored, or the variables are misconfigured. There is absolutely no reason whatsoever to have but a dozen of these variables for the whole system. If users see these variables in all documents or multiple of these variables in their documents, they should ask the system administrator to remedy this situation.
TypeDescription
CASE VARIABLEInput box that allows users to type data during merge
INPUT VARIABLEInput box that allows users to type data during merge

Special Variables:

TypeDescription
SPECIAL
Variables listed in the type Special are variables that do not belong in other categories. For the most part, they were created for specific circuits and print very specific data. In time, more columns were added, and a few columns deserve a special mention: User, User Name, and Write Your Own. There is a special section added exclusively for the Write Your Own.

Variable Columnvalue or where it can be set
AGENCY REPORT NO WITHOUT PAGERemoves portions of the agency report number
ALIAS REAL NAMEFor AKA records, this list the name defined as the real name of that person
BOOKING LISTA list of booking number
CASE DEFENDANTLists all co-defendants on consolidated cases
CASE DEFENDANT DEMOGRAPHICSLists all co-defendants name and demographic information on consolidated cases
CASE DEFENDANT NAMELists all co-defendants on consolidated cases
CASE DEFENDANT, ALIASES AND DEMOGRAPHICSLists all co-defendants and their aliases on consolidated cases
CASE DEFENDANT, ALIASES, JACKET AND DEMOGRAPHICSLists all co-defendants, aliases, their JACKET No, and demographics on consolidated cases
CASES BY DEFENDANTList of other cases for a defendant
CHARGE TITLECharge title for consolidated charges
CHARGE TITLE, BONDCharge title and bond amount for consolidated charges
CHARGE TITLE, SAGESCharge title and SAGES for consolidated charges
CONSOLIDATE CASE NUMBERSList of consolidated cases
CONSOLIDATE CLERK LISTList of the clerk number for consolidated cases
CONSOLIDATE FDLE, STATUTE NO, DEGREEList of charges in a consolidated case
COUNT, CHARGE, DISPO ACTION, REASON, SENT, S CONDLists the county number, charge description, disposition action, reason, sentence, and sentence special conditions
DEF LIST OPEN CONSOLIDATED CASESList of open consolidated cases for a defendant
DEFENDANT AGEThe age of the defendant
DEFENDANT AND ALIASESDefendant name and aliases
DEFENDANT AND ALIASES NAME, IDList of consolidated cases with their directory id
DEFENDANT DEMOGRAPHICSName and demographics of defendants on consolidated cases
DEFENDANT DEMOGRAPHICS, NAME, RACE, AND DOBName and demographics of defendants on consolidated cases
DEFENDANT, ALIASES AND DEMOGRAPHICSName, Aliases, and demographics of defendants on consolidated cases
DOCUMENT SEQUENTIAL NUMBERThis variable lists a unique id for each document, allowing it to be used as a receipt number or a unique identifier for the document. To enable this feature go to the Document Options code table and add the Event that will be added to the Event tab with the sequential number/ID, once a case is merged using this variable
EVENT DATE FOR CONSOLIDATED CASESDate when a case was consolidated
GUARDIAN NAME
MONTH, YEARCurrent Month and Year. This variable can be used in places like the certificate of service
OFFENSE DATE
OPEN CASES BY DEFENDANTList of Open Cases for the defendant
RELATED CASEList of cases Related to the current case. This can be set in the Case Tab
RELATED TO CASEList of cases Related to the current case. This can be set in the Case Tab
SA04 CHARGE LIST
SA10 CASE NO
SPECIAL PROS DEPARTMENT PHONE
TODAYCurrent date and time
USERCurrent user login
USER EMAILCurrent user email address
USER NAME (FML)Current user name
USER PHONE NUMBERCurrent user phone number
USER SIGNATURECurrent user signature
WRITE YOUR OWNRead more about WYO below

Write Your Own variables:

The Write Your Own (WYO) variable allows the system administrator to write and publish variables that are capable to retrieve any piece of data in the database. It does require knowledge in both SQL and the data structure in STAC, but for the agencies that don’t have someone who knows SQL, CIP can work with them to write variables as needed.

Another great advantage of this variable is that it allows variables to be created or modified without having to wait for a new release to be published since these variables don’t have to rely on modifications in the applications

Arguments

Two arguments can be used in this variable.

ArgumentDescription
:incidentidthis variable is how the application passes the id of the case being merged. This argument works on any type of document
:directoryidThe directory id is only available for documents of type Relationship. This is how the system passes the directory_id of the person selected. If a WYO variable is written using this argument and used on a Case Document, it will most likely return no results

Limitations

Write Your Own (WYO) variables can return one or multiple records. When the variable returns multiple records, be sure to set the appropriate List Connector to merge the users results as a list or as a paragraph. This variable returns only one column, so the select statement has to concatenate the result in a single column. Users should take advantage of the functions published by CIP to allow converting and format dates, time, money, and integer fields to a string so they can be concatenated. Additionally, the default behavior in SQL is to transform the whole string into a NULL value when any of the fields being concatenated is NULL, so remember to use the ISNULL function.

Write Your Own Variables
    • Related Articles

    • How to configure the Document Maintenance?

      Introduction Merging documents is without a question one of the most powerful functions in the system. Agencies can design and create their own documents pulling data from STAC. There are variables available to retrieve dates, names, charges, ...
    • How to setup E-service?

      How to configure Documents to be E-serviced? To setup an e-service document, the admin will need to fill out the information in the Document maintenance such as the Categories and variables for the document. The important setup that differentiates ...
    • How to Merge Documents?

      How to merge a document? With the case selected, select the Merge button at the top of the screen. Once selected, the Document categories are available on the left and makes it easy for users to find the document they need to use for the specific ...
    • How to Configure Variables?

      How to Configure Variables? Go to: Setup > Codes > Variables Field Description Variable Name This is the name of the variable and the identifier that is sent to the word processor. Avoid renaming variables, for it will cause errors on all documents ...
    • What are the different types of Documents?

      What are the available Document Types? There are two types of documents: Case and Relationship. Case Documents when merged yield one document per case. Relationship documents yield one document per relationship selected. Letters and subpoenas are ...