The Address Block object introduced in OL Connect Designer 2024.1 allows you to effortlessly insert and format addresses according to the specific postal guidelines of over ten countries, including the United States, Canada, United Kingdom, Germany, France, and more. This ensures that your documents meet the necessary standards right out of the box.

Additionally, the feature includes a Generic address block template to handle data with preformatted postal address lines (for example, address1, address2, etc.).

Skip empty lines

The Address Block object automatically collapses any optional address lines that are empty, for example a company name, job title or department name. This option ensures that these empty lines do not take up unnecessary whitespace in the merged result.

Custom address block templates

OL Connect Designer allows you to create custom address block templates. This feature enables you to add templates for regions not currently supported or to meet specific requirements of postal agencies and parcel delivery services. This option requires knowledge of the Handlebars library.

Getting started with the Address Block object

To add an Address Block object:

  1. Open your template in OL Connect Designer.
  2. Load data containing address information.
  3. Navigate to the toolbar and select the Address Block object icon. The Address Block object dialog appears.

To configure the Address Block object:

  1. From the Address format combo menu, select the country for which you need the address formatted.
  2. Link your data fields to the address components.
  3. If you need the address to be aligned to the bottom of the Address Block object, click the Align text to bottom option.
  4. Click OK to insert the Address Block object.

Note! The address template for the selected country may have separate fields for the street name and house number. In cases where this data is provided in a single field, you can map that data field to the Street field. A similar scenario applies to a pre-formatted name of the recipient. In this case the data field could simply be mapped to the First name or Last name. The results will automatically appear in the preview area for validation.

The Address Block is an absolute positioned object that can be easily placed at the desired location using drag and drop. To modify the settings of the object, right-click on it and select Address Block… from the contextual menu.

Handling preformatted address data

When working with preformatted postal address lines, each line already contains complete information, such as the recipient’s full name and contains separate address lines for the addition address components.

In this scenario, you can use the Generic address block template. Each field in this template represents a single line in the address block. The advantage of using this template is that it automatically applies the Skip Empty Lines option and allows you to select the Align Text to Bottom option.

In the following example, the address1 field contains the optional company name (this field could also be labelled as company), and the address2 field contains the recipient’s full name, and so on. In the preview, the empty fields address1 and address4 are automatically skipped.

If certain lines in your data are not fully composed, these can be combined into a single field using the DataMapper component in the Enterprise or Professional editions of OL Connect.

Custom Address Block templates

If an address format is not yet available for your country, region, or postal service specific format, you could create a custom address format. As previously mentioned, this requires knowledge of the Handlebars library.

Custom Address Block templates use the .hbs extension (Handlebars file) and are stored in the ProgramData folder on the local machine. In a multi-user or server environment, these templates must be copied to that location on all necessary machines.

The following shows a basic example opened in a text editor (Visual Studio Code). The file is called sample.hbs and stored in the Address Blocks folder stored under ProgramData.

The full path is:
C:\ProgramData\Objectif Lune\OL Connect\Address Blocks\sample.hbs

The expressions use the OLC prefix followed by two digits: 00-99. The digits determine the order of the address fields in the Address Fields column. OLC00 comes first, OLC99 comes last.

In the example expressions are placed in paragraph elements (<p></p>). Empty <p> elements in HTML are automatically collapsed by the browser used by OL Connect. Additionally, the example demonstrates the use of inline styling, conditions with the Handlebars if statement, and formatters like upperCase.

The following image shows the template in the Address Block dialog:

Sample snippet:

<p style="font-weight:bold;color:red">{{OLC10Company}}</p>

<p>{{OLC30FormOfAddress}} {{OLC32FirstName}} {{OLC32LastNamePrefix}} {{OLC33LastName}}</p>

{{#if OLC60Street}}
<p>{{OLC60Street}} {{OLC61HouseNumber}}{{OLC62Extension}}</p>
{{/if}}

<p>{{OLC70Postcode}}&nbsp;&nbsp;{{#if OLC71City}}{{upperCase OLC71City}}{{/if}}</p>

Note! Detailed information on this functionality is found in the online help:
https://help.uplandsoftware.com/objectiflune/en/olconnect-desktop/2024.1/designer/VariableData/Address_Format_Template.html

Leave a Reply