Working with Print Templates is one of the most useful features of the Agiloft Contract Management platform. However, there are times that things don’t work as expected, and it can be difficult to understand why the field or formula in your print template is not working as expected. Here are two scenarios that you might face and some practical solutions.
A field tag or formula is not working as expected: Often, parts of the tag will display as text in the documents generated from the template. Here, it’s important to know that Word uses all kinds of invisible formatting tags to handle the display of docx files. Sometimes, these tags can get inserted in the middle of your tag or formula, breaking it. In cases like this, using the “Format Painter” can fix the problem easily. Choose one character from your tag or formula (I like to use the “$”), highlight it and click “Format Painter”
Then, hold down shift and use your mouse/trackpad to select the entire tag or formula. This ensures that all the characters use the same formatting so that there are no invisible Word tags present.
You want to have Date numbers with superscript ordinals (“st”, “nd”, “rd”, etc.): This can be done with a complex-looking formula that uses regular expressions to add the desired superscript. This example is formatted using the Contract Start Date, but can be adapted to End Date or any other date by simply changing the field tags.
Simply applying the superscript formatting to the formula as you see in the image should give you the format you want. The logic of the formula for Date Format is more fully explained in this post: How to automatically append suffixes after days of the month (i.e. 1st/2nd/3rd/4th)