Skip to main content
These sample scripts assemble documents into document sets defined by a Document Set Definition and report assembly problems through the AssemblingErrors object. The first script requires different documents depending on a loan sum. The second checks that a set contains the expected identification documents.

Require documents based on the loan sum

This script assembles documents into document sets defined by a Document Set Definition. The Document Set Definition contains a section named Borrower’s form and references to the following Document Definitions:
  • Passport
  • Guarantor’s documents
  • Co-borrower’s documents
  • Employer reference
The Borrower’s form section includes the following fields:
  • Co-borrower’s name
  • Loan sum
The documents that the document set must contain depend on the value of the Loan sum field. The script uses two threshold values to determine which documents are required: If the Co-borrower’s name field contains a value, the document set must also contain a co-borrower’s documents. The following script uses this logic to assemble document sets:

Check for missing or duplicate documents

This script works with the Identification Documents Document Set Definition, which references the following Document Definitions:
  • Passport
  • Driver’s license
A document set may contain at most one document of each type, and must contain at least one of these documents. The following script uses this logic to assemble document sets: