Label variables quick reference

To save time and effort later, use the naming conventions below when for variables in PDFs and DOCXs you intend to run through the AssemblyLine Weaver interview code generator. If you do, the Weaver will infer how to handle them and make this part of the code it produces. For example, a variable that is clearly a date will be treated as a date within the interview code generated by the Weaver. Note: The examples below are only a subset of the variables housed in the AssemblyLine library, but they should help you learn how to construct variables the Weaver will understand.

Example documents#

Prefixes:#

Note: prefixes are Reserved words for objects.

People Prefixes#

Variable names the Weaver will automatically treat as people.

Use caseDocument output formatPDF labelYAML/DOCXInterview order
name of the 1st userFirst M. Lastuseruser[0]user[0]
name of the 1st other partyFirst M. Lastother_partyother_parties[0]other_parties[0]
name of the 1st plaintiffFirst M. Lastplaintiffplaintiff[0]plaintiff[0]
name of the 1st defendantFirst M. Lastdefendantdefendant[0]defendant[0]
name of the 1st petitionerFirst M. Lastpetitionerpetitioner[0]petitioner[0]
name of the 1st respondentFirst M. Lastrespondentrespondent[0]respondent[0]
name of the 1st spouseFirst M. Lastspousespouse[0]spouse[0]
name of the 1st parentFirst M. Lastparentparent[0]parent[0]
name of the 1st guardianFirst M. Lastguardianguardian[0]guardian[0]
name of the 1st caregiverFirst M. Lastcaregivercaregiver[0]caregiver[0]
name of the 1st attorneyFirst M. Lastattorneyattorney[0]attorney[0]
name of the 1st translatorFirst M. Lasttranslatortranslator[0]translator[0]
name of the 1st debt_collectorFirst M. Lastdebt_collectordebt_collector[0]debt_collector[0]
name of the 1st creditorFirst M. Lastcreditorcreditors[0]creditors[0]
name of the 1st childFirst M. Lastchildchildren[0]children[0]
name of the 1st guardian ad litemFirst M. Lastguardian_ad_litemguardians_ad_litem[0]guardians_ad_litem[0]
name of the 1st witnessesFirst M. Lastwitnesseswitnesses[0]witnesses[0]
name of the 1st decedentFirst M. Lastdecedentdecedents[0]decedents[0]
name of the 1st interested partyFirst M. Lastinterested_partyinterested_parties[0]interested_parties[0]

Other reserved names#

Other names the Weaver will automatically know.

Use caseDocument output formatPDF labelYAML/DOCXInterview order
name of the courtCourt Nametrial_courttrial_courttrial_court
docket number (singular)123456docket_numberdocket_numberdocket_number
docket number (of multiple)123456docket_numbers1docket_numbers[0]docket_numbers[0]
Date that the user signs the formFebruary 4, 2021signature_datesignature_datesignature_date
User needs an interpreterCheckbox checkeduser_needs_interpreteruser_needs_interpreteruser_needs_interpreter
User's preferred languageSpanishuser_preferred_languageuser_preferred_languageuser_preferred_language

Suffixes:#

Note: Suffixes are Reserved words for attributes.

Field types#

_date Something ending in _date will automatically show up in the Weaver as a date field. Example: hearing_date

_yes combined with _no

For PDFs specifically. When two otherwise identical labels in a PDF end in _yes and _no, they will be combined into one variable in the interview order, and will appear in the online interview as a single checkbox. Example: is_minor_yes and is_minor_no

Document output formatPDF labelYAML/DOCXInterview order
Minor 'Yes' checkbox is checked or blankis_minor_yes"is_minor_yes": ${ is_minor is True }is_minor
Minor 'No' checkbox is checked or blankis_minor_no"is_minor_no": ${ is_minor is not True }is_minor

Suffixes for People and Things#

Suffixes can be added to people or things to provide attributes. Consider that we want to collect information about a parent in some proceeding. One attribute of this parent might be their birthdate, another might be their address. In the table below we show how this could be expanded in the case of some general parent.

Note: When using these suffixes in a DOCX, the base variable name should be plural (e.g., parents).

Use CaseDocument output formatPDF labelYAML/DOCXInterview order
name of the 1st parentFirst M. Lastparent_nameparents[0].nameparents.gather()
name of the 1st parentFirst M. Lastparent_name_fullparents[0].nameparents.gather()
first name of 1st parentFirstparent_name_firstparents[0].name.firstparents.gather()
middle nameMiddleparent_name_middleparents[0].name.middleparents.gather()
middle initialsM.parent_name_middle_initialparents[0].name.middle_initial()parents.gather()
last nameLastparent_name_lastparents[0].name.lastparents.gather()
suffixJrparent_name_suffixparents[0].name.suffixparents.gather()
gender of 1st parentfemaleparent_genderparents[0].genderparents[0].gender
birthdate01/01/2001parent_birthdateparents[0].birthdate.format()parents[0].birthdate
birthdate01/01/2001parent_ageparents[0].birthdate.format()parents[0].birthdate
emailsomeone@example.comparent_emailparents[0].emailparents[0].email
address street120 Tremont Stparent_address_streetparents[0].address.addressparents[0].address.address
120 Tremont Stparent_address_addressparents[0].address.addressparents[0].address.address
address street 2Unit 2parent_address_street2parents[0].address.unitparents[0].address.unit
address unitUnit 2parent_address_unitparents[0].address.unitparents[0].address.unit
address cityBostonparent_address_cityparents[0].address.cityparents[0].address.city
address stateMAparent_address_stateparents[0].address.stateparents[0].address.state
address zip02108parent_address_zipparents[0].address.zipparents[0].address.zip
address countryUSAparent_address_countryparents[0].address.countryparents[0].address.country
Multi-line full address~parent_address_blockparents[0].address.block()parents[0].address.address
Full address on 1 line120 Tremont St, Unit 2, Boston, MA 02108parent_address_on_one_lineparents[0].address.on_one_line()parents[0].address.address
address 1st line120 Tremont St, Unit 2parent_address_line_oneparents[0].address.line_one()parents[0].address.address
address city, state zipBoston, MA 02108parent_address_city_state_zipparents[0].address.line_two()parents[0].address.address
mailing address street120 Tremont Stparent_mailing_address_streetparents[0].mailing_address.addressparents[0].mailing_address.address
120 Tremont Stparent_mailing_address_addressparents[0].mailing_address.addressparents[0].mailing_address.address
mailing address street 2Unit 2parent_mailing_address_street2parents[0].mailing_address.unitparents[0].mailing_address.unit
mailing address unitUnit 2parent_mailing_address_unitparents[0].mailing_address.unitparents[0].mailing_address.unit
mailing address cityBostonparent_mailing_address_cityparents[0].mailing_address.cityparents[0].mailing_address.city
mailing address stateMAparent_mailing_address_stateparents[0].mailing_address.stateparents[0].mailing_address.state
mailing address zip02108parent_mailing_address_zipparents[0].mailing_address.zipparents[0].mailing_address.zip
mailing address countryUSAparent_mailing_address_countryparents[0].mailing_address.countryparents[0].mailing_address.country
Multi-line full mailing address~parent_mailing_address_blockparents[0].mailing_address.block()parents[0].mailing_address.address
mailing address on 1 line120 Tremont St, Unit 2, Boston, MA 02108parent_mailing_address_on_one_lineparents[0].mailing_address.on_one_line()parents[0].mailing_address.address
mailing address 1st line120 Tremont St, Unit 2parent_mailing_address_line_oneparents[0].mailing_address.line_one()parents[0].mailing_address.address
mailing address city, state zipBoston, MA 02108parent_mailing_address_city_state_zipparents[0].mailing_address.line_two()parents[0].mailing_address.address
An image of a signature-parent_signatureparents[0].signatureparents[0].signature
landline number of 1st parent123-123-1234parent_phone_numberparents[0].phone_numberparents[0].phone_number
mobile number of 1st parent123-123-1234parent_mobile_numberparents[0].mobile_numberparents[0].mobile_number
one or more phone numbers of 1st parent123-123-1234 (cell) or 123-123-1234 (other) or 123-123-1234 (cell) 123-123-1234 (other)parent_phonesparents[0].phone_numbers()parents[0].phone_number

Additional Docassemble resources:

  1. Names
  2. Other things to do with individuals

Court#

Use CaseDocument output formatPDF labelYAML/DOCXInterview order
name of the courtCourt nametrial_courttrial_courttrial_court
county of the courtCounty nametrial_court_countytrial_court.address.countytrial_court.address.address
division of the courtDivision nametrial_court_divisiontrial_court.divisiontrial_court.division
department of the courtDepartment nametrial_court_departmenttrial_court.departmenttrial_court.department

More than one#

Situations where you have any of these:

  1. More than one item in a group, like 2 parents
  2. The document needs the information for an item to be printed in multiple places
  3. You have a big area where you want to list a group of names or other values

You can do the below for any reserved word on the page. You can also use these methods in combination.

Multiple items of one category#

For example, when there are multiple children.

Use CaseDocument output formatPDF labelYAML/DOCXInterview order
name of the 2nd parentFirst M. Lastparent2_nameparents[1].nameparents.gather()
age of the 3rd child14child3_agechildren[2].agechildren[2].age

Print a value in multiple places#

warning

In a PDF you have to use a unique label for every field. See below for how to deal with this. This does not apply to DOCX files.

When docassemble reads PDFs, each field should have a unique label. That means if you need to put a plaintiff's name in multiple places on the form, you need to add two underscores (__) and a number to the end of the label each time. Example: plaintiff__1 and plaintiff__2.

Use CaseDocument output formatPDF labelYAML/DOCXInterview order
1st appearance of name of 1st plaintiffFirst M. Lastplaintiff__1plaintiffs[0].gather()plaintiffs[0].name
2nd appearance of name of 1st plaintiffFirst M. Lastplaintiff__2plaintiffs[0].gather()plaintiffs[0].name

Print all the items in one spot#

List all the plaintiffs, all the docket numbers, etc. All people words can be used.

Use CaseDocument output formatPDF labelYAML/DOCXInterview order
list of all docket numbers123456, 654321docket_numbersdocket_numbersdocket_numbers
one or more phone numbers of 1st parent123-123-1234 (cell) or 123-123-1234 (other) or 123-123-1234 (cell) 123-123-1234 (other)parent_phonesparents[0].phone_numbers()parents[0].phone_number
full name of every userFirst M. Lastusersusersusers.gather()
full name of every other_partyFirst M. Lastother_partiesother_partiesother_parties.gather()
full name of every plaintiffFirst M. Lastplaintiffsplaintiffsplaintiffs.gather()
full name of every defendantFirst M. Lastdefendantsdefendantsdefendants.gather()
full name of every petitionerFirst M. Lastpetitionerspetitionerspetitioners.gather()
full name of every respondentFirst M. Lastrespondentsrespondentsrespondents.gather()
full name of every spouseFirst M. Lastspousesspousesspouses.gather()
full name of every parentFirst M. Lastparentsparentsparents.gather()
full name of every guardianFirst M. Lastguardiansguardiansguardians.gather()
full name of every caregiverFirst M. Lastcaregiverscaregiverscaregivers.gather()
full name of every attorneyFirst M. Lastattorneysattorneysattorneys.gather()
full name of every translatorFirst M. Lasttranslatorstranslatorstranslators.gather()
full name of every debt_collectorFirst M. Lastdebt_collectorsdebt_collectorsdebt_collectors.gather()
full name of every creditorFirst M. Lastcreditorscreditorscreditors.gather()
full name of every childFirst M. Lastchildrenchildrenchildren.gather()
full name of every guardian_ad_litemFirst M. Lastguardians_ad_litemguardians_ad_litemguardians_ad_litem.gather()
full name of every witnessFirst M. Lastwitnesseswitnesseswitnesses.gather()
full name of every decedentFirst M. Lastdecedentsdecedentsdecedents.gather()
full name of every interested_partyFirst M. Lastinterested_partiesinterested_partiesinterested_parties.gather()

Combining#

You can combine the methods on this page in many ways. Here are some examples

Use CaseDocument output formatPDF labelYAML/DOCXInterview order
1st appearance of the name of the 2nd parentFirst M. Lastparent2_name__1parents[1]parents.gather()
2nd appearance of the name of the 2nd parentFirst M. Lastparent2_name__2parents[1]parents.gather()
2nd appearance of 3rd child's age14child3_age__2children[2].agechildren[2].birthdate
3rd appearance of a full list of all plaintiffsplaintiffs__3plaintiffsplaintiffs.gather()

DOCX only#

Some reserved words that are just in DOCX files.

Use CaseDocument output formatYAML/DOCXInterview order
1st child's date of birth01/01/1991children[0].birthdatechildren[0].birthdate
display birthJanuary 1, 1991children[0].birthdate.format()children[0].birthdate
Age for young children2 years or 4 months or 2 weeks or 2 dayschildren[0].formatted_age()-
the 1st names of all the children joined with 'and'. Works for a single child too.Firstname1, Firstname2, and Firstname3children.familiar()-
the 1st names of all the children joined with 'or'. Works for a single child too.Firstname1, Firstname2, or Firstname3children.familiar_or()-
one or more numbers of 1st parent123-123-1234 (cell) or 123-123-1234 (other) or 123-123-1234 (cell) 123-123-1234 (other)parents[0].phone_numbers()-

For more about .format(), see the docassemble DADateTime documentation

Definitions#

Reserved words#

AssemblyLine's ALWeaver has some specific words that it knows to look for so it can help make your work easier. Those reserved words are listed here.