Doc Auto template syntax
To create the template needed for Document Automation, open the template in Microsoft Word. You should already have syntax similar to the image below.
To edit the fields go to the left of each line and right-click, as shown in the image below. Choose
Edit Field
.
The
Field
window displays.
The field name needs to be updated to reflect the information that needs to be added.
You need to enter the characters exactly as displayed, with the same casing.
Each section of information should be added in between the two apostrophes e.g. 'comments I have added'. For example:
#set($sheetTitle='
Enter your sheet title here
')
#set($viewName='
Enter the view here e.g. Default
')
#set($map={"c1":"
Enter the lookup column name here||enter the name of the first column you want to lookup here
"})
$!{map.put("c2","
Enter the lookup column name here||enter the name of the second column you want to lookup here
")}
$!{map.put("c3","
Enter the lookup column name here||enter the name of the third column you want to lookup here
")}
#set($fieldsMap=$utils.getSheetDocReportDataMap( $sheetTitle,$viewName,$map))
#foreach($key in $fieldsMap.keySet())
#set($innerMap=$fieldsMap.get($key))
#foreach($innerKey in $innerMap.keySet())
Once you have added the required information it should look like this:
The highlighted areas in the example above should contain your own references.
The
||
(double pipe sign) indicates a
lookup column
(the two examples, 'c1' and 'c2' in the image above). The 'c3' line in the example above references a single-line text column, so does not need to include a
||
. In this example, the lookup columns are from another iSheet, selected when you created the lookup column in the iSheet.
To remove a line from the syntax (for instance, a column because it's not needed) just highlight the line and delete it.
To add a line into the syntax, copy a line already in the syntax, click at the end of the row above where you want to add the line and tap enter. Select
Insert
, click on the
Quick Parts
icon (1),
Field
(2), and then
Insert Field
(3). Paste the copied line and change
c1
to the next column number, depending on how many are in the list e.g. 2, 3. Select
OK
to save the update.