1. Help Center
  2. Document Automation

How do I code documents for Document Automation? Part 3: behaviours.

This article explains how to use behaviours, which modify and enhance Document Automation. This article also provides a list of all current behaviours and how they work.

dealcloser's Document Automation system is very flexible but it's critical that you keep a few things in mind when coding documents:

  • Plan ahead - consider how you want the document or set of documents to behave when automated and think through what kinds of snippets (defined below) you'll need.
  • Be consistent with your coding - make sure you're using exactly the same codes for the same details every single time.
  • Small details matter - snippets are written in a very specific way and missing a piece of a snippet will prevent Document Automation from working.

Behaviours make Document Automation even more scalable and powerful. For example, with behaviours, you can turn a Closing Date Input from a simple text string input to a date picker input. 

  • To add behaviours to your snippets, use the following snippet format:

{{“Group Name” | “Variable” : Behaviour()}}

Please note that you must always have a variable in your snippet but a group name and a behaviour are optional.

Mandatory: {{“Variable”}}

Optional: {{"Group Name | “Variable”}}

Optional: {{“Variable” : Behaviour()}} 

Date Picker Behaviour

  • To turn an Input from a simple text string input into a date picker input, use the following behaviour (in this case, the variable is "Closing Date"):

{{"Closing Date : Date()}}

  • Doing so will turn the Closing Date Input in dealcloser from a text string input that looks as follows:

Text String Input.

  • Into a date picker input that looks as follows:

Date Picker Input.

  • Additionally, when using the date picker behaviour, you can select the date format you'd like to dealcloser to adopt when writing the date into your documents.

Date Format Selection.

  • You can use the following date formats:
    • Long: July 5, 2022
    • Medium: Jul 5, 2022
    • Short: 7/05/2022
    • Formal: the 5th day of July, 2022