Manage and Build Templates

The Manage and Build Templates section is where you can upload your .docx templates for exporting. Click here for an overview of this feature.

To summarise, you can populate and export a word or pdf file with images, data lists and content and field values simply by referencing the field slug, e.g. a field called My First field would be filled as ${my_first_field} in the word doc.

Create Mockup

By Clicking "Generate Mockup" you can get a .docx file that contains all your field slugs.

This is a feature that allows you to export the file straight from the Data results.

Upload Template

You can upload as many templates as you like and they will be available to choose from in the front end of the bloc.

Template files must be .docx files

Template List

Once your templates are uploaded, they will appear in the Template List where they can downloaded or deleted.

Using the Template Builder: Tips & Tricks

Standard field value population

By using the field slug in this format on the document the value will replace this field: ${my_first_field}.

WYSIWYG for User Fields

These fields contain html and this html will correctly convert and populate your word file.

Image and File Fields

Images will successfully appear in the word doc. You can also adjust the image size by adding numbers into the variable, for example: ${my_image_field:200:100} where 200 is the width and 100 is the height.

Digital Signatures

Digital Signatures will successfully populate into the file.

Sub Bloc and Results Box Fields

There is an advanced feature within this overall feature, where you can display lists of data in a table if the field is either a Sub Bloc or a Results Box. It displays the data from the these external blocs instead of the data in the main parent bloc that you are exporting the document from. It works by using the filters you have set out in those fields as a means of finding the data to display. You can see this in action in this How to Video from 18 minutes onwards.

Euro auto formatting

If you append [euro] to a field it will format it to a euro format e.g. ${[euro]total_cost} , if that value was 234 the output will be €234.00

Field Slug Population Feature

You can actually insert field slugs in the value of a field in a bloc and if you append [blcx_slug_population] it will process these first before it does all the fields without this. It's a way to put field slugs inside field slugs.

An example might be where you want a different data set entirely being populated into the one place. Example, some invoices want a Finance Company address, and others want a Customer address then using existing Blocworx features you could populate a field like "address" with actual field slugs So the address field could have a value: "${finance_company_name}, ${finance_company_address}" In a different situation the address field might have a value: "${customer_name}, ${customer_address}"

In your template if you do the following ${[blcx_slug_population]address} It will populate the value, e.g. ${customer_name}, ${customer_address} These populated fields will now get processed normally as if they had been put in the template manually.

Dynamic Line Breaks

If the value in your field has [BLCX_LINE_BREAK] it will automatically create a line break in the value. E.g. if you have a merge field that results Hello[BLCX_LINE_BREAK]World, it will appear in the template as Hello World This also works with the dynamic field slug population feature described above.

Conditionally Show content if field exists or not

You can decide to show something in the doc based on whether another field has a value or not ${[blcx_if]-saying_hi[thenshow]='Hi'} in this example, if saying_hi is there, and is not equal null or N/A then it will show a Hi. If its not there, or if its there but equal N/A or null, it won't show anything.

Last updated

Was this helpful?