This article discusses switches, or specific formatting, for merge fields used in conjunction with Filevine’s Word exports. Filevine relies on merge fields to populate Word templates for reports and Filevine Fusion. By adding field switches after the Filevine field name, the format of the exported data can be finely tuned to meet any document requirements. With switches, minute control over the display of text, numbers, and dates is possible.
When a document is generated, Filevine replaces merge fields with data so that only text remains. Only the field switches listed below are supported for formatting Filevine merge fields. Other formatting, QuickParts, and Word Fields can be used in tandem with Filevine’s fields, but those elements will need to be updated manually to show the correct values.
Note: Special straight bracket merge codes can also be used for documents sent to Vinesign templates, in order to automate creation of Vinesign template fields. Learn more about these special merge codes.
How to Edit Merge Fields
Merge fields appear in curly brackets in your Word document. Press Alt + F9 to toggle the field coding on and off, and you will see the merge field coding appear and disappear in the document.
To add merge fields, click Insert > Quick Parts > Field and select MergeField from the field names list. Here, you can also add formatting after the merge field. When you’ve added the desired formatting, click OK to add the merge field to the document.
To edit or add formatting to a merge field, press Alt + F9 to reveal the merge field coding. Then, right-click on the merge field to edit the merge field. You can also add the formatting directly in the document. To add formatting to a field, append the switch—including backslash—after the field name:
{ MERGEFIELD fieldName \[Formatting here] }
Text Formatting
Text can be automatically formatted in multiple combinations of capital or lowercase letters. Examples of these switches are in the table below.
Switch |
Description |
Example |
---|---|---|
\*Caps |
Capitalizes the first letter of every word |
Handsome Law Group |
\*FirstCap |
Capitalizes only the first letter of the field |
Handsome law group |
\*Upper |
Capitalizes all letters |
HANDSOME LAW GROUP |
\*Lower |
All lowercase letters |
handsome law group |
Amount Formatting
Amount fields in Filevine can be formatted to account for different combinations of symbols and digits. After inserting the field switch “\#”, the number’s formatting is set using “tokens,” or characters that act as holding places, in a specific pattern. The arrangement of tokens is completely custom, and the document to be generated will dictate which tokens are appropriate. A list of token examples can be found at the bottom of the table below.
Token |
Description |
---|---|
0 |
Displays a digit; if blank, a “0” is inserted |
# |
Displays a digit; if blank, nothing is inserted. |
, |
Separates digits into groups, like hundreds, thousands, etc. |
. |
Determines the location of the decimal separator in the result. |
##% |
Multiplies number by 100 and adds the percent symbol. |
Nx |
Outputs source number to “x” decimal places. |
Px |
Outputs source number × 100 to “x” decimal places, with a percent symbol. |
$, £, °, “USD”, “CAD”, and other text and symbols |
Text and symbols can be added to the formatting code to display in-line with the result. |
These tokens are used in a determined pattern to display the way amounts look. Some examples of what amount formatting can do are below.
Code |
0 |
9534 |
0.12 |
---|---|---|---|
\# “$#,##0.00 USD” |
$0.00 USD |
$9,534 USD |
$0.12 USD |
\# “00000000” |
00000000 |
00009534 |
00000000 |
\# “N1” |
0.0 |
9534.0 |
0.1 |
\# “P2” |
0.00% |
953400.00% |
12% |
Custom Date Formatting
Similar to the amount formatting switch, adding the field switch “\@” specifies a custom date/time format. The date formatting switch can be applied to date fields, deadline fields, and built-in timestamps, like audit logs. Custom text can also be included in the formatting code to display inline with the date output.
Token |
Description |
Example |
|
---|---|---|---|
Month |
M |
The month, from 1 to 12 |
1 2 … 11 12 |
MM |
The month, from 01 to 12 |
01 01 … 11 12 |
|
MMM |
The abbreviated name of the month |
Jan Feb … Nov Dec |
|
MMMM |
The full name of the month |
January February … December |
|
Day |
d |
The day of the month, from 1 through 31 |
1 2 … 30 31 |
dd |
The day of the month, from 01 through 31 |
01 02 … 30 31 |
|
ddd |
The abbreviated name of the day of the week |
Sun Mon … Fri Sat |
|
dddd |
The full name of the day of the week |
Sunday Monday … Friday Saturday |
|
Year |
yy |
The year, from 00 to 99 |
70 71 … 18 19 |
yyyy |
The year as a four-digit number |
1970 1971 … 2018 2019 |
|
Hour |
h |
The hour, using a 12-hour clock, from 1 to 12 |
1 2 … 11 12 |
hh |
The hour, using a 12-hour clock, from 01 to 12 |
01 02 … 11 12 |
|
H |
The hour, using a 24-hour clock, from 1 to 24 |
1 2 … 23 24 |
|
HH |
The hour, using a 24-hour clock, from 01 to 24 |
01 02 … 23 24 |
|
Minute |
mm |
The minute, from 00 through 59 |
00 01 … 58 59 |
Seconds |
ss |
The seconds, from 00 through 59 |
00 01 … 58 59 |
AM/PM |
t |
The first character of AM or PM |
A P |
tt |
AM or PM |
AM PM |
Here are some examples of what different date formatting will look like:
Code |
05/29/2019 1:45 PM |
---|---|
\@ “M/d/yyyy” |
5/29/2019 |
\@ “MM-dd-yy h:mm tt” |
05-29-19 1:45 PM |
\@ “ddd, MMMM d, yyyy at HH:mm” |
Wed, May 29, 2019 at 13:45 |
Conditional Formatting
Conditional codes can help to maintain clean formatting, preventing gaps caused by blank fields, or they can be used to add formatting, like a comma between fields.
Two codes are used to include specific text only if the field in Filevine is not blank: “\b” and “\f”. Add these codes at the end of a merge field followed by the text or formatting you would like to be included in the case that the field is not blank. “\b” inserts text before the merge field, and “\f” inserts text afterward.
The following examples reference addresses. If you are adding typical address formatting, you can also use {{sectionname.fieldname.addressBlock}} or {{sectionname.fieldname.addressBlockWithCompanyInfo}} to insert an already-formatted address block, or a formatted address block including the person’s position and company name.
Line Breaks
The “\b” code can be used to insert a line break before a merge field code only if the field is not blank. This formatting can effectively “hide” the second line of an address when that field is empty.
To hide the field when empty, insert the “\b” code after the clientAddress1Line2 field, followed by a line break, like so:
{ MERGEFIELD clientAddress1Line1 }{ MERGEFIELD clientAddress1Line2 \b”
“}
{MERGEFIELD clientAddress1City}
This formatting will add a line break before the clientAddress1Line2 merge field only if that field is filled, meaning that the line break will not be added if the clientAddress1Line2 field is blank.
Output 1 |
Output 2 |
---|---|
518 Crestview Drive |
129 West 81st Street |
Adding Formatting
The “\b” and “\f” codes can also be used to insert any other formatting that should only be added when the field is filled. For example, to add a comma after the client’s city address only if the city field in the address is filled, add a “\f” code after the clientAddressCity merge field, followed by the comma, like so:
{ MERGEFIELD clientAddressCity \f “,” }{ MERGEFIELD clientAddressState } { MERGEFIELD clientAddressZip }
This formatting will add a comma after the city in the client’s address only if the city field is filled. If the field is blank, the comma will not be added.
In the example above, a carriage return is inserted before Line 2 of the address, but only if that field is populated. This arrangement keeps the address block clean and neatly formatted in all situations.
Comments
0 comments
Article is closed for comments.