Building a Document Export Query
  • 03 Dec 2025
  • Dark
    Light
  • PDF

Building a Document Export Query

  • Dark
    Light
  • PDF

Article summary

To export documents from Slate, you’ll create a query that returns one row per document. You can use filters to limit the documents that are returned by this query.

Creating the query

  1. Go to Queries / Reports.

  2. Select New Query.

  3. Configure the following settings:

    • Name: Enter a name for the query.

    • Folder: Select an existing folder, or select Other to create a new one.

    • Type: Configurable Joins

    • Category: Related

    • Base: Document
      Configure_New_Query_Settings.png

  4. Select Save.

  5. Select Edit Properties.

  6. Configure the following settings:

    • Limit Rows: There is a strict limit of 5,000 documents per query execution, so this must be a value of 5,000 or less.

    • Execution Options: Retrieve only the new records since the query was last run

    • Fetch Behavior: Preserve where clause on fetch if required by one or more filters.

    • Queue: None (default)

      • Queues can’t be used with a document export.

      • Do not adjust this setting.

    • Secondary Key: Paste the following:

      doc__JID_.[stream]

  7. Select Save.

Adding required exports

To create a document export query, you must include the direct exports pdf:xml and pdf:file:

  • pdf:xml: Specifies the file data to export

  • pdf:file: Determines the filename

To add these exports to the query:

  1. Select Export.

  2. Select pdf:file and pdf:xml.
    Exports_-_pdf-xml__pdf-file.png

  3. Select Continue.

  4. Select Rename Exports.

  5. For both exports, remove the preceding Document . The exports must be named pdf:file and pdf:xml.
    Rename_Exports.png

  6. Select Save.

Adding metadata

You can add metadata to your exported documents by recreating the pdf:xml direct export as a subquery export.

📖 Adding a Header or Footer to Documents in a Document Export Query

Customizing file names

Slate generates unique file names for exported documents using the pdf:file direct export.

You can customize the file name scheme by recreating pdf:file as a subquery export.

📖 Customizing the document file name in a document export query

➡️ Next up: Scheduling the document export

Your next step is to configure the query’s schedule export settings, which define the format of the exported files.

➡️ Scheduling document exports


Was this article helpful?