Explanation on how to use mergefields.
Experienced Expert


Mergefield can be used in a document template so that when generating a document this Mergefield will be filled in with data from Coachview. The Mergefield can be recognized by the brackets [ ]. In the editor, after selecting an example template (or data group), a number of menus appear in the editor in which the Mergefield are listed. A number of menus have a level, indicated by a number. This means that they are part of a so-called 'loop' (repetition of data). When and how you can use them you can read below.

Mergefield menu:

Move the cursor to the location where the Mergefield should be located in the editor and select the desired Mergefield from the menu.

In a menu you will find 3 different types of Mergefields:

  1. in white, the 'normal' Mergefields.
  2. in grey, the 'free fields' of Mergefields
  3. in yellow, the 'loop (repetition)' Mergefields.

The first two types of mergefields are very similar, the only difference is that free fields are customer specific. Furthermore, they work in the same way. Select the right menu, choose a merge code and it will be placed in your document. These mergefields can be recognized by the fact that they have a colon in the code, for example: [Persoojn:NaamVolledig] The loop mergefields are a bit more complicated, so I will explain them in a separate menu below.

Loop - step by step explanation:

The 'loop' mergefields are needed if you want to get a mergefield from one of the menus with a level indication. It's called a loop because you're consulting a series of items that you want to retrieve the merge code from each item.

For example: you want to generate a list of names of participants in an email to be sent to the teacher. There are 4 participants, you use datagroup:TrainingTeacher and you want Coachview to show the first name and gender.

Loop (herhaling)Result
Place 1st item
Retrieve mergefields for [first name] and [gender].
Place next item (item 2)
Retrieve mergefields for [first name] and [gender].
Place next item (item 3)
Retrieve mergefields for [first name] and [gender].
Place last item (item 4)
Retrieve mergefields for [first name] and [gender].

Piet Man

Janneke Vrouw

Mick Man

Marloes Vrouw

Because we don't know in advance how many items there are, we only put the start and end signal in a loop and the merge codes in between. Coachview knows that first we have to look at the first item and when we encounter the 'end of loop signal', we check if there is another item and start again at the top in the loop. If there is no next item, the loop is closed. So you could rewrite the loop above to a shortened version, like the one below:
Loop (repetition)Result
Start loop
Samenvoegcodes ophalen: [voornaam] en [geslacht]
end loop
Piet - Man
Janneke - Vrouw
Sandra - Vrouw

All we have to do now is convert the above loop to encryption that Coachview understands. And we can do that by using the 'loop' merge code from the menu. When choosing such a field the following will appear in your editor:
Loop (repetition)Explanation
[OpleidingDeelnemer]Returns the merge code before the start of the loop.

(a 'loop  mergefield' is recognizable by the fact that it has no colon : in it).

/* Hier kunnen niveau 1 OpleidingDeelnemer velden ingevoegd worden */Indicates a remark in which you can set the desired text and/or mergefields. Note: the special characters at the beginning /* and at the end */ should also be removed.
[/OpleidingDeelnemer]Indicates the end of the barrel.

(A 'loop mergefield' can be recognized by the fact that there is no colon : in it)

Note: it looks like the same merge code, but you shouldn't forget the '/'!

We're almost done, just adding an extra piece of coding to the 'loop mergefields'. Note that when you add this encoding, you will see that the 'loop mergefields' are no longer visible in the editor. Don't worry, if you go to the source code you will still see it! Here is a final example of what your loop looks like:
Loop (herhaling)Uitleg
[Persoon:Voornaam] - [Persoon:Geslacht_]<br>

The <br> in HTML code means an enter, the next name is written on the next line.
Piet - Man
Janneke - Vrouw
Sandra - Vrouw

Placing a loop in a table

First make sure you know how a table is constructed in html (info). We use the same example as above, so we already know which merge codes to use.

Think about which information should be in a loop, and which information should not. Probably you don't want the table titles in the loop, because they don't have to be repeated over and over again. Probably the loop will be in the Tbody (or the filling of the table):

Source codeResult


If the loop doesn't appear in the table yet, the mergefield can't be found, so they are seen as 'text' instead of 'mergefield'. That's why you can still see the mergefield in the result above.

The next step is to add the loop mergefield, so that the merge codes are recognized and filled in. We place the start signal of the loop in front of the code to create a new line <tr> and the end signal after the code to end a line </tr>. We do this because the loop must start with creating a new line, then create the columns with the merge codes, and then end the line. After that, the loop should see if there is a new item and if so, create a new line again, etc.

Source codeResult



Data notations

Data notations:
Day number short
Day number
Day name abbreviation
Day name full
we; Fr
Wednesday; Friday
Monthly number short
Monthly number
Monthly name abbreviation
Monthly name full
Year 1 number
Year 2 numbers
Year 4 numbers
\@ "dd-MM-yyyy"
\@ "ddd d MMM yy"
\@ "d MMMM"
\@ "yyyy/M/d"

do 9 mar 07
9 March

Time formats

Time formats:



Hour short (scale 0-12)
Hour long (scale 0-12
Hour short (scale 0-23)
Hour long (scale 0-23)

Minute short
Minute long

Second short
Second language



\@ "HH:mm:ss"
\@ "H:m:s"

Combinations of date and time formats are also possible.

For example, "dd-MMM-yyyyy / HH:mm:ss" is shown as "09-03-2007 / 15:08:02".

Other possibilities:


If the first letter has to be an uppercase letter:
[Persoon:Adressering \* "FirstCap"]


If the whole field has to be uppercase:
[Persoon:Plaats \* "Upper"]

Notations of personal names:

Persoon:NaamVolledigAnnemarie van der Aa
Persoon:NaamAa, A.G.M van der
Persoon:NaamFormeelA.G.M van der Aa
Persoon:Adresseringmevrouw Ing A.G.M van der Aa
Persoon:Aanhefmevrouw Van der Aa