Manage and Build Templates
Last updated
Was this helpful?
Last updated
Was this helpful?
The Manage and Build Templates section is where you can upload your .docx templates for exporting.
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.
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.
You can upload as many templates as you like and they will be available to choose from in the front end of the bloc.
Once your templates are uploaded, they will appear in the Template List where they can downloaded or deleted.
By using the field slug in this format on the document the value will replace this field: ${my_first_field}.
These fields contain html and this html will correctly convert and populate your word file.
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 will successfully populate into the file.
Having a field in the child Sub Bloc that is the same name as a field in the parent bloc can cause the system to not understand which one to use, and a result either the table of data may not appear, or the parent field will be blank. It is possible to distinguish between the two by simply adding [parent] to the field slug in the doc file. E.g. ${[parent]my_first_field} By doing this the system will be able to distinguish between the two fields even if they have the same name.
There is also a second way these can be distinguished. You can add the field slug of the Results Box field itself before the field slug that you are loading. E.g Supposing you have a Results Box field called Invoice Line Items and its slug is invoice_line_items. You can be explicit about what field you are loading by adding this slug followed by a hyphen, in this example the Model Number might be model_number as part of a line item. ${invoice_line_items-model_number}
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
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.
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.
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.
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 or a . 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 .