Creating multiple documents

In version 4.1 and later of the Berkeley Studio, you are able to create multiple documents with different names based on variables used in the model. This tutorial will explain how you can do so.

In this tutorial we will use a model with a repeat. If you haven’t yet read the explanation on repeating, we recommend you to do so first.

The model

The model used for this tutorial looks like the picture below. The introduction node provides an introduction, the information node contains a repeat, a graph over which to repeat, and a question which asks how many times one has to go through the graph. The result node contains a closing text.

creating multiple documents model overview
creating multiple documents model overview

Within the subgraph ‘gnames‘ which is repeated, there are two nodes, one named names and one named document. The names node contains two questions, ‘name’ and ‘surname’, which asks the user for their name and surname. These are the variables that will be used to add to the document name (see picture below).

names node
names node

Preparing the document node

The document node is the most important node in this feature. In this node, we will retrieve all variables that we want to use in the document name and create the document itself.

Now, create a text fragment in which you place the variables asked in the names node. Then, to make use of these variables, you will have to retrieve them from the previous node. In this example, add a formula called ‘name’ and set the formula to names.name. Do the same for the surname. You should have something as follows in the Actions panel.

actions panel document node
actions panel document node

Adding the document

Now, add a document. If you need some refreshment about how to add a document, please have a look at our tutorial on document assembly.

To add a variable to the filename, simply use the caret symbol ‘^’ before the variable name. If you have multiple variables that you want to use, it is necessary to put the variables between accolades ‘{ }’. In the case of this example, the filename of the created documents should be: ‘document_of_name_surname. To get this, enter the following as the filename: document\_of\_^{name}_^{surname}.

adding variables to the document name
adding variables to the document name

Now, press [OK], save the model and you are able to run it. To view the documents created, you will have to go to the document folder at the location where you saved the model.