Adding text fragments
This section builds on the model and document shown in the Introduction to Document assembly and Adding a document to your model. In those two articles, we showed how you can add a document to your model and present it to your user. In the coming sections on text fragments, we will explain how you can put content in your document.
A text fragment is an action in the Berkeley Studio that creates a piece of text. Asides from the text, it also has a name and you can give it a condition. A text fragment can be created from almost anything, including plain text, questions and formulas. After a text fragment is created, you can put it in your template. Whenever a user runs through your model, the text will be put in the template and will be appear in the document.
A text fragment out of a question
In our example model (found at Introduction to Document assembly) we have a node called
This node contains several questions about the buyer, such as his name and date of birth.
We can create a text fragment out of this question in two ways.
The easiest way is to right-click the question and select
Copy this into text fragment.
This will show a window where you can enter the name for the text fragment, after which the fragment is added.
The other way is to manually add the question to a text fragment.
To do so, first add a new text fragment via
[Actions > Text fragment].
Make sure you add this fragment after the question you want to put into it.
This ensures the question is answered first, otherwise it would be empty.
Give the text fragment a name, and place select the
Text block field.
Then, select the Finder or press
Navigate to the question and double-click it to add it.
After you’ve done this,
name will appear in red in the text block.
This is short for the full name of the questions (
We’ve now added our first text fragment. Adding more text fragments can be done in exactly the same way. As mentioned before, you can also create them from formulas or the results of functions.