Documents
Find a customer's documents and change their type or status
Last updated on
With these actions you work with a customer's documents, such as an insurance proof of payment. The type and the expiry date of a document are in the document details. In a flow you read them as {document.userMetadata.documentType} and {document.userMetadata.insuranceExpiryDate}.
Find document
Finds a customer's newest document. The step has two exits: Found and Not found.
| Field | What you fill in |
|---|---|
| Customer | The id of the customer, for example {document.customerId} or {customer.id}. Required |
| Type | For example Insurance payment proof. Leave empty for any type |
| Skip archived documents | On by default |
| Only documents that have not expired | The expiry date must be after now. Documents without an expiry date then do not count. Off by default |
If several documents match, the step takes the newest. Via Found, later steps can use {foundDocument.id}, {foundDocument.name}, {foundDocument.status}, {foundDocument.userMetadata.documentType} and {foundDocument.userMetadata.insuranceExpiryDate}.
This way you can check, for example, when an insurance has expired, whether the customer already has a new, valid proof of payment: search with Type Insurance payment proof and Only documents that have not expired on, and only continue via Not found.
Update document
Changes the type of a document, or archives or restores it. Empty fields stay as they are.
| Field | What you fill in |
|---|---|
| Document | The id of the document. {document.id} by default. Required |
| New type | Leave empty to keep the type |
| Status | Active or Archived. Leave empty to keep the status |
A type that requires an expiry date, such as Insurance payment proof, fails if the document has no expiry date. The action returns {updatedDocument.id}.