Skip to Content
AutomationsActions

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.

FieldWhat you fill in
CustomerThe id of the customer, for example {document.customerId} or {customer.id}. Required
TypeFor example Insurance payment proof. Leave empty for any type
Skip archived documentsOn by default
Only documents that have not expiredThe 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.

FieldWhat you fill in
DocumentThe id of the document. {document.id} by default. Required
New typeLeave empty to keep the type
StatusActive 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}.

Was this page helpful?

On this page