How to set a dynamic filename

Set the name of a recipe based on text element name.

Prerequisites

We assume that you've created recipes before, that you're familiar with forms and recipe references, and that you've read the reference page for dynamic filename.

Scenario

A municipality is receiving requests for building permits. They generate responses by creating a recipe for a Building permit resolution. Each building permit is approved or rejected, which they implement by adding an Approval or Rejection text element to the recipe.

Set a dynamic filename

For this process, the content of documents and text elements doesn't make a difference. You can use an empty document to simulate each of the three documents used here.

  1. Navigate to the Create admin site, and a unit and content source of your choice.
  2. Create three Word recipes, named:
    1. Building permit resolution.
    2. Approval.
    3. Rejection.

The Building permit resolution, Approval, and Rejection documents.

  1. Upload an empty Word document to each of the recipes.
  2. Enter Building permit resolution.
  3. Change the name of the Form group to Resolution.
  4. Add a RecipeReference form field. Set Title and Key to Resolution, then add references to Approval and Rejection, with both Identifier and Label set to Approval and Rejection respectively, then Save the recipe.

The finished text element setup.

  1. Navigate to the Gear settings menu in the top bar of the Recipe editor, and then to Dynamic filename.
  2. Set Filename template to Building permit - {1}.
  3. Under Configuration items, select Add item. Then set Target to Resolution and Property to filename. Save the document.

A successfully set up dynamic filename.

  1. Create a document from your new recipe to confirm that it works as expected. The resulting name should be Building permit - Approval if the permit's approved, and Building permit - Rejection if the permit's rejected.

Congrats! You've automated the file name of a recipe with a text element.