•••
 
Documentation   /   Actions   /   Document actions
 
 

Document actions

 

Document actions create and work with documents. The template or document must belong to your account, or to your group if group sharing is turned on.

The answer of a document action is the document's key. Later items can use it as {{item_id}} or {{alias}}, and every variable in the document as {{item_id:variable}} or {{alias:variable}}.

Passing values into documents

Most document actions take ---pass_variables, which sets the document's values:

---pass_variables:{key_1}_IS_{value_1}_AND_{key_2}_IS_{value_2}

Keys can be any variable defined in the template, or one of the reserved variables, such as counterparty, address, date_start, folder or the signatory fields. Values can be text or {{variables}}:

---pass_variables:counterparty_IS_{{company_name}}_AND_date_start_IS_{{start_date}}_AND_salary_IS_{{salary}}_AND_offer_sig:email_IS_{{candidate_email}}

Make document (manually): specific_document

Shows a button that opens the document creation form, so the user enters the details. Anything in ---pass_variables is filled in for them.

Directive Required Description
---options Yes The template key.
---button_text No Button label. Default: "Create document".
---pass_variables No Values to fill in.
--#item:
---id:engagement_letter
---title:Create the engagement letter
---action:specific_document
---options:{template_key}
---button_text:Create letter
---pass_variables:counterparty_IS_{{client_name}}

Make document (automatically): auto_document

Plainly creates the document with no input from the user.

Directive Required Description
---options Yes The template key.
---stage No How far to go: create (default) creates the document; lock also locks it ready for signing; send also emails it to the signatories, using the template's email; finalise creates and finalises a Static document.
---pass_variables No Values to fill in.
---button_text No Label of the button used to recreate the document if the first one is deleted.
--#item:
---id:offer_letter
---alias:offer
---title:Offer letter
---action:auto_document
---options:{template_key}
---stage:send
---pass_variables:counterparty_IS_{{candidate_name}}_AND_salary_IS_{{salary}}_AND_offer_sig:name_IS_{{candidate_name}}_AND_offer_sig:email_IS_{{candidate_email}}
Important

lock and send fail if the document has a variable with no value and no fallback text. Pass every variable the template needs, or give template variables fallback text.

Copy a document: copy_document

Creates a new document from an existing one, keeping its text and data. Use it for renewals, amendments and new versions.

Directive Required Description
---options Yes The key of the document to copy, or the ID or alias of an earlier item that produced one.
---pass_variables No Values to change in the copy.

Get a document: get_document

Fetches an existing document, shows it in the task and imports its data.

Directive Required Description
---options Yes A document key, or a {{variable}} containing one.
---done_at Yes Set to 1 so the item completes and the workflow can continue.
--#item:
---id:master_agreement
---title:Your master agreement
---action:get_document
---options:{{master_agreement_key}}
---done_at:1
---outcome:next_step

Include a document's data: include_document

Like Get, but hidden from users: it only imports the document's data.

Directive Required Description
---options Yes A document key, or a {{variable}} containing one.
---done_at Yes Set to 1.

Update a document: update_document

Changes one or more variables in an existing document. Hidden from users.

Directive Required Description
---options Yes A document key, or the ID or alias of an earlier document item.
---pass_variables Yes The variables to change.
--#item:
---depends_on:approval
---id:mark_approved
---action:update_document
---options:offer
---pass_variables:approved_by_IS_{{u_name}}_AND_approved_on_IS_{{*today}}
---outcome:send_offer

Delete a document: delete_document

Deletes a document. Hidden from users.

Directive Required Description
---options Yes A document key, or the ID or alias of an earlier document item.
Important

Deleting a document can't be undone from the workflow.

Showing a document without importing it

A Hidden or Output text item can show a document in the task by including a ---document_key:{document_key} directive.