Customizing the Document File Name in a Document Export Query
  • 15 Nov 2023
  • 3 minute read
  • Dark
    Light
  • PDF

Customizing the Document File Name in a Document Export Query

  • Dark
    Light
  • PDF

Article Summary

When creating a Document Export query using the Configurable Joins - Document query base, a standard pdf:file export is available as a Direct Export, which generates a unique filename for the exported documents. This extends to Configurable Joins the functionality of the pdf:file export from the Slate Template Library - Document Export (Application) query base.

If you are required (or choose) to modify the file names of your exported documents, use the Configurable Joins - Document base to create a custom filename export using a Subquery Export.

Creating a custom filename export

If a custom file name is required, the pdf:file export can be built using a Subquery Export. This process requires two steps and starts with an optional step:

  1. Optional: Add joins

  2. Add the pdf:file subquery export and any additional required exports.

  3. Add literals to ensure the resultant file type is correct.

Step one (optional): Adding joins

You may require additional joins to access the information desired in the document filename. This example, used for materials associated with an application in Slate, adds three joins. The application and application/person joins will only return values for application-scoped materials.

  1. Locate the Joins section at the bottom of the query summary page and click Join. An Insert Query Part popup appears.

    new_cjs_doc_export_query_whole_ui.png

  2. Select the Application export under the Joins section under the Document category.

  3. Click Continue. An Edit Part popup appears to confirm the export.Application Join 

  4. Click Save and New. The Insert Query Part popup appears.

    Save Application Join

  5. In the Joins section, under the Application category, select Person.

  6. Click Continue. An Edit Part popup appears to confirm the export.

    Insert Query Person

  7. Click Save and New. The Insert Query Part popup appears.

    Edit Part Person 

  8. In the Joins section, under the Document category, select Lookup Material.

  9. Click Continue. An Edit Part popup appears to confirm the export.

    Insert Query Lookup Material

  10. Click Save. The query summary page appears with the three new joins added.

    Edit Part Lookup Material

    cjs_doc_export_query_with_joins.png

Step two: Adding exports

With the appropriate joins in place (if any), the pdf:file subquery export can be built as follows:

1. On the query summary page, in the Exports section, click the subquery button Subquery Button (next to the Export button). An Edit Part popup appears.

2. Name the export pdf:file.

3. Change Output to Concatenate. Options for Row Separator and Row Offset appear. Leave these fields as-is.

Edit Part Ready for Exports

4. Add the desired exports to use for the file name. In this example, the exports are:

  • Reference ID (in the Direct Exports section, under the Person category)

  • Export Value (in the Direct Exports section, under the Lookup Material category)

  • Date (in the Direct Exports section, under the Document category)

5. Click Continue. The exports appear on the Edit Part popup for the subquery export.

pdf_file_subquery_export_with_exports_only.png

Step three: Adding literals

Add literals to the exports to ensure that the resulting file type is correct and make the file name more readable.

This example adds dashes.

1. Click the Literal button on the Exports line. An Edit Part popup appears.

Literal Button

2. Give the literal a value for Name, and add the literal character to the Literal field. In this case, the literal is a dash (-) character. The Name value can be anything, but to keep things easier to follow, the dash is used in both the literal and the Name values.

3. Click Save. The literal appears in the list of exports.

Edit Part Literal

4. Hover over the dash literal and select the copy icon. A Copy Part popup appears.

Copy the Literal

5. Click Save Copy. The additional literal appears on the Edit Part popup list of exports.

Save Literal Copy

6. Drag the literal to the desired location in the list of exports.

Relocated Literals

With the desired literals added to the base file name, create an additional literal and a file type export to complete the file name.

7. Click the Literal button. The Edit Part popup appears.

8. Add a period (.) for the Literal value (you can also use the period character for the Name).

9. Click Save.

Edit Part Add Dot

10. Click the Export button. An Insert Query Part popup appears.

12. In the Direct Exports section, under the Document category, select File Type.

13. Click Continue. The Document File Type export is added to the list of exports.

Insert Query File Type

14. Click Save. The completed subquery export for generating the custom file name now appears on the query summary page.

Export List Completed



pdf_file_subquery_complete_on_query.png


Was this article helpful?