Field labels to use in template files
The Document Assembly Line framework can help you automate templates that use any
field (or variable) names that you choose. However, you should use the names
that we list below for full compatibility.
Example documents
As a supplement to reading these documents, you can use a Custom GPT to apply the information they contain:
The Custom GPTs have instructions to help you come up with a label for any field in your document that follows the rules.
AI can make mistakes! Always double-check the information it gives you.
The basics
Fields, labels, and variables
A blank space on a paper form is usually called a form field, or field for
short. We call adding unique names that refer to those blank spaces labeling
them.
When you access the labeled field in your docassemble code, it is usually called
a variable.
General rules for labels
You should always use the specific labels from this page when they match the concepts in your form. But if you cannot find a matching label, use the general rules below to add as many custom labels as you need.
Labels should be valid Python variable names that start with a letter
PDF and DOCX labels should also work as valid Python variable
names. The basic rule is that Python variable names
need to start with a letter and can only contain letters, digits, and the _
underscore character. Some variable names are
reserved and have a special meaning inside
AssemblyLine interviews. You should not use a variable name on the
reserved list. Doing so can lead to
hard to track bugs.
Variable names are case sensitive - make them all lowercase
Field names are case sensitive. The convention is to never re-use variable names with different capitalizations to store different things. Stick with all lower case names for fields when possible.
Use the Python snake_case format for field labels
In PDFs, labels should be all one word, lowercase, with multiple words separated
by an underscore, the _ character. This convention is called snake_case. Do
not use a . symbol or [] inside a PDF field's label.
In a DOCX file, you can use the . symbol as well as brackets [] but they
have a special meaning. The . separates an object from its attribute, and
the [] indicates that you are referencing a list of items. Beginners should
avoid these symbols except when instructed to do so for one of the variable
names below.
Use short but descriptive labels
Use variable names that are descriptive but also short. Avoid using abbreviations. A good rule of thumb is to spell out acronyms and initialisms for clarity, but to freely remove words other than nouns and verbs to keep the names short. Use a name you would still understand if you read it in a year.
About 30 characters is a good limit to the length of a variable name. It's unusual to need more than that. If your variable name is shorter than 5 characters, it might not be descriptive enough.
Some suggestions for coming up with custom labels
There are no hard and fast rules other than the ones listed above, but here are some conventions that may help you:
- Drop words from the variable name that don't add specific meaning. Filler words like "a", "the", etc. are almost never needed. Stick with nouns and verbs.
- Yes/no variables (also called
boolean) commonly start with a form of the verb "to be" or "to have", paired with a noun. E.g.,is_attorneyorhas_notice_to_quit. You can also use other verbs--writes_docassembleorsaved_statusorwants_copies_returned. - Do not include the type of variable in the variable name itself. It is
usually redundant and is not a common Python style. Exception: you might add
something like
_listor_datethat is both a type and is descriptive of the variable's real world contents. - There are now a number of samples of interviews built with the Assembly Line framework that you can find online. You can get ideas for variable names to use in your interview that match if they apply to the same concepts.
When you're stuck, feel free to ask for help! It's a good idea to get a second opinion the first few times you label a document. A fellow programmer may have some good ideas to make your variable names shorter, clearer, or more closely follow programming conventions.
How the Assembly Line labels work
We have identified common fields that exist in most paper court forms:
- names of people
- addresses
- information that identifies the court
- signatures
- dates
- currency figures
- a pair of yes/no checkboxes
- docket numbers or court filing numbers
We came up with a convention to identify the roles that people may play in relation to your form:
- The "user" of the form: the person who the form is being filed for, making a request or response to the court
- The "other_party" of the form: the person who the user is responding to or suing
We have also identified some common names for people that appear across many forms.
By using the labels for fields that we selected, you will be able to use the questions that we have vetted and pre-written without needing to write them from scratch. You still have the option to customize those questions later.
For those with programming experience, we turn most of the field labels that we
recognize into objects. Learn more about the Individual
object in the docassemble
documentation.
Special names for special roles: users and other_parties
Where possible, you should use the label users for the person who the
interview is benefiting and other_parties for the person that is on the other
side of their dispute. Sometimes this is not known. In that situation, you
can use the labels plaintiffs and defendants or petitioners and respondents.
The term users does not always mean the person sitting in front of the screen.
We use the term "user" to mean the person who the form is for. I.e.,
it should usually not be used to identify an attorney or advocate filling
in a form for someone else. In a court case, the user should normally
be a party to the case.
People are "plural" by default
We made the choice to make all variables representing people plural by default. This allows us to use consistent terms across the many forms that do allow multiple parties in different roles.
Special situation for names of people in PDFs
In PDF forms, you can identify a single person's name like this:
users1, users2. This is due to a limit in how PDF labels work.
When the form is automated in the Weaver, the field name becomes part of a list:
users. There is also a special syntax that lets you indicate which item in the
list you are accessing, with the first item starting at 0: users[0] represents
the first user, users[1] the second, and so on.
The docassemble and DOCX variable name users[0] is the equivalent of users
or users1 in a PDF label. users[1] is the equivalent of user2.
Names are not transformed at all when you work in a DOCX template. You need to use the docassemble syntax from the beginning if you are identifying a specific person in a list.