Customizing Document Export File Names for Scheduled Exports
  • 15 Nov 2023
  • 2 minute read
  • Dark
    Light
  • PDF

Customizing Document Export File Names for Scheduled Exports

  • Dark
    Light
  • PDF

Article Summary

By default, individual documents generated by a Document Export query are given file names based on a unique identifier provided for each material record. However, file names can be customized to meet the requirements of another system that receives documents exported from Slate. 

Formula parts can be used to customize the file name of the generated documents and, if needed, the index key generated in the Index File from a Document Export (Application) query.

Customize Export File Names

Navigate to the Edit Query view of the query, and inactivate or remove the standard versions of the 'File name' and 'pdf:file' exports, if they are present in the query.  The File name export is the row name in the material index file. The pdf:file export is the file name of the pdf. 

Do not remove or inactivate the 'pdf:xml' export as it is required to generate the documents.

  1. Select Formula on the query part palette.

  2. In the Edit Part window, give the formula part a Name of pdf:file (the name must be exact to generate the file).

  3. Select Add Export to search and select the fields required to compose the file name:

    • Once the exports have been added, double-click on each export, and give it a computer-friendly name (no spaces)

    • In the Formula section, add @ with the name(s) of the export(s) used for the file name formula. Use the + sign to concatenate multiple exports.

    • If the formula export includes multiple export parts to combine into one file name, then the formula would look like the example below:

    • If the file name requires a delimiter between each export part within the formula export, a character such as - or _ may be added to the formula

    • The following extension may be hard coded at the end of the formula to generate a .pdf:

      + '.pdf'

      Alternately, the following may be hard coded at the end of the formula to ensure that the file name extension matches the Document Type selected in the Scheduled Export settings (.pdf, .tiff, or .jpg):

      '.' + (select q.[config].value('(p[k = "export_archive_type"]/v)[1]', 
      'varchar(16)') from [query] q where ([id] = @query))

      SQL knowledge is not required to create a formula export

      Be wary of using special characters in filenames - some of them may prevent documents from being generated correctly.

    • If an index file is required, add a new Formula from the query part palette.

      • In the Edit Part window, give the formula part a Name of File name (the name must be exact to generate the index file).

      • Repeat Step 3 above; the exports and formula used must match the 'pdf:file' formula export. 

Important

It is not possible to use a configurable export in a formula. 


Was this article helpful?