SortDocuments

A step that is based on the SortDocuments step template updates the document properties file to reorder the documents in a group according to their values for the sort properties. For example, you can sort the documents in a job to appear in ascending order by account number. You can select up to six fields from the document properties file by which to sort the documents.
The step first defines the document sequence (using the Sequence in Child property) according to the first sort property and direction. The step then refines the document sequence for each set of documents that all have the same value of the first sort property. The step uses the second sort property and direction to refine the values in each of the sets. The step repeats this process for the remaining sort properties.

Job property defaults

  • Sort first: Not set
  • First sort direction: Not set
  • Sort second: Not set
  • Second sort direction: Not set
  • Sort third: Not set
  • Third sort direction: Not set
  • Sort fourth: Not set
  • Fourth sort direction: Not set
  • Sort fifth: Not set
  • Fifth sort direction: Not set
  • Sort sixth: Not set
  • Sixth sort direction: Not set

Usage notes

  • You cannot copy or delete this step template.
  • The sort is based on Unicode values in UTF-8 order.
  • Sorting occurs within existing document groups established by GroupDocuments or SplitDocuments.
  • Make sure that your selections in the drop-down lists are valid at the point in the workflow when the step based on SortDocuments runs. For example, if you want to sort by the Document ID property value, a step based on WriteDocumentsToDatabase must precede SortDocuments because Document ID values are defined when WriteDocumentsToDatabase runs.
  • SortDocuments updates the values in the document properties file, not the database. To update the database values of document properties, add a step based on UpdateDocumentsInDatabase in your workflow after SortDocuments.
  • The type of comparison that is done depends on the data type associated with the property. A property that stores string values uses a character comparison (even if the values are numbers). Properties that have a list of values are sorted according to the collating sequence defined for the list, not on a character comparison. Numeric data types are sorted based on a numeric sort.
  • If a sort property is specified but the corresponding sort direction field is empty, the step orders the results in ascending order.
  • If any of the sort properties have no value, sorting occurs according to the remaining properties. If no properties have a value, no sorting occurs.
  • If a Child Job ID property is set in the document properties file, sorting occurs within each child job ID.
  • The Sequence in Child property shows the numerical order of this document in the child job. When you sort the documents, the value of this attribute can change, but the actual ordering of the documents in the document properties file does not change.