In recent months we were busy updating our backend code to use modern approaches and technologies. It’s important, but almost invisible work. Yet, we added a pair of user-visible features we want to share with you. These are Update Fields option for documents and PNG format support for logo images.
Update Fields for Microsoft Word documents
Microsoft Word supports about 60 different fields and supports formula evaluations. The field consists of two parts: field/formula code and its actual value. You can toggle between field’s codes and values via Toggle Field Codes menu or by pressing Alt+F9.
When we process document template, we do pinpoint changes. We replace MERGEFIELDs with corresponding record values and just that.
In some scenarios it might be useful to place the MERGEFIELD inside another field ( IF for example) or formula. But substitution of MERGEFIELD does not trigger outer formula re-evaluation.
As fields are specific to Word document format, PDF conversion component evaluates and replaces all Word fields with their values. We thought it must be useful to apply field re-evaluation feature for Word documents as well and added Update fields checkbox (which is unchecked by default for safety) to the document template settings.
![New Update fields option in documents](https://www.teamdesk.net/blog/wp-content/uploads/2024/10/image.png)
When checked, after replacing MERGEFIELDs with their values we perform an additional pass evaluating and replacing with their values all remaining fields in the document.
Examples
Example 1: Text as a result of comparison
Consider the field: { IF { MERGEFIELD Amount } = 1 One Many }
First pass will replace { MERGEFIELD Amount } with actual value of the Amount, say 2. However, calculated value of the IF field displayed to the user remains the same. With Update fields checked, second pass will evaluate { IF 2 = 1 One Many } and replace it with word Many.
Example 2: Formatting numbers
TeamDesk supports limited set of format modifiers on MERGEFIELDS directly, but you can use full Word’s potential using MERGEFIELD inside formula field.
Consider the scenario: a financial document with contract’s sum is written in words. Word has a nice CardText modifier, just for that. All you need to do is to place merge field inside the formula field with CardText modifier.
{={MERGEFIELD Contract_Sum} \* CardText}
On first pass we will replace {MERGEFIELD Contract_Sum} with a value, say 1000, updating outer field’s code to {=1000 \* CardText}. With Update fields checked, second pass will replace {=1000 \* CardText} with calculated value, words one thousand.
PNG Logo Support
Domain, database and workspace logos can now use image transparency with support of PNG format.
This is important for new UI, which supports light and dark color schemes, though useful as well for old UI with customized background.
![Database logo on light and dark backgrounds](https://www.teamdesk.net/blog/wp-content/uploads/2024/10/image-1.png)
Previously, we automatically converted all image types to JPEG. As JPEG does not support transparency, white background was added in place of transparent pixels. Now, if the image you upload is in PNG format and does not exceed 300×100 pixels in size, we use it as is. If the image exceeds the boundaries or provided in the format other than JPEG or PNG, we still downscale it and convert to JPEG.
This is great !
Thanks for this new feature at the same price !
I do not need anymore to have my number to text conversion formula
Is the “Page Break” feature for pdf also new or had I missed it ?
The “Page Break” option has been available for years. It ensures that each new record in a multi-record document template starts on a new page.