Explanation on how to use mergefields Editor version 2.0.
Experienced Expert

Why?

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
[OpleidingDeelnemer]
[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
[/OpleidingDeelnemer]


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
<table>
<thead>
<tr>
<th><strong>Naam</strong></th>
<th><strong>Geslacht</strong></th>
</tr>
</thead>
<tbody>
         <tr>

            <td>[Persoon:NaamVolledig]</td>
            <td>[Persoon:Geslacht_]</td>
         </tr>
</tbody>
</table>

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
<table>
<thead>
<tr>
<th><strong>Naam</strong></th>
<th><strong>Geslacht</strong></th>
</tr>
</thead>
   <tbody>

      <!--[OpleidingDeelnemer]-->
         <tr>

            <td>[Persoon:NaamVolledig]</td>
            <td>[Persoon:Geslacht_]</td>
         </tr>
       <!--[/OpleidingDeelnemer]-->
</tbody>
</table>


Data notations

Data notations:
CodeDescriptionExample
d
dd
ddd
dddd
Day number short
Day number
Day name abbreviation
Day name full
9
09
we; Fr
Wednesday; Friday
M
MM
MMM
MMMM
Monthly number short
Monthly number
Monthly name abbreviation
Monthly name full
3
03
mar
March
y
yy
yyyy
Year 1 number
Year 2 numbers
Year 4 numbers
7
07
2007
Examples:
\@ "dd-MM-yyyy"
\@ "ddd d MMM yy"
\@ "d MMMM"
\@ "yyyy/M/d"

09-03-2007
do 9 mar 07
9 March
2007/3/9


Time formats


Time formats:

Code:
h
hh
H
HH

m
mm

s
ss
Description:
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
Voorbeeld:
3
03
15
15

8
08

2
02

Examples:
\@ "HH:mm:ss"
\@ "H:m:s"
15:08:02
15:8:2

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