The merge code concept
| The content of this website is last updated to F2 version 12. cBrain are working hard on supplying you with the newest documentation of F2. | 
A merge code is the code written in templates in place of the desired data that is retrieved from merge fields. Merge codes are always one of three general types:
- 
Codes retrieving metadata on records.
 - 
Codes retrieving metadata on cases.
 - 
Codes retrieving participant data used when copying records to multiple recipients.
 
The merge codes follow a specific syntax. Every code starts with a “$” followed by text specifying the desired type of code.
For example:
- 
$dossierfor record information. - 
$casefor case information. - 
$mergepartyfor merging information from multiple participants on copies of records. 
The type is followed by the name of the desired merge field, and the code is finalised by another “$”.
The merge code’s parts are linked together with “_”. For example, to insert the responsible user for a record, the corresponding merge code would look like this:
- 
$dossier_responsiblename$ 
| Merge codes must follow the above syntax to work as intended. Further examples of correct merge codes can be found in Merge field examples. | 
Organisations using case guides will also be able to retrieve data from related merge fields using the prefix $case_fielddata.
Merge codes referring to empty data fields will be removed when generating documents, so any generated document will be free of codes. Please note that this does not apply to $mergeparty codes.
Merge codes can also be used in combination with the F2 Phrases module (documentation available in Danish) to merge information into standard texts.