Removing Blank Data
There will be occasions when you generate your message and you might see some blank lines between text. This occurs when there is blank data in the field you are trying to generate message content for.
There are three ways that Tourplan can remove blank field text and the use of each is dependant on how user organisations have created and setup their message definition templates.
The three techniques that Tourplan uses are:
Understanding the techniques above is critical to effectively formatting your messages, either to display information when there is data present or removing information when there is no data available.
Zero Flagging
Zero flagging is a technique that removes text where the value is 0. An example of this is where you have accommodation services and all variations of substitution codes are used to show all room types <SG> <DB> <TW> <TR> <QD> <OT>.
Messaging Code | Generated Message |
---|---|
<SG> <DB> <TW> <TR> <QD> <OT> |
Single 1 Double Twin Triple Quad Other |
To eliminate blank spaces where the booking has a double room booked and none of the other room types are booked. Inserting the codes <SG:0> <DB:0> <TW:0> <TR:0> <QD:0> <OT:0> in to the Message Definition Template would generate the number of double rooms without any spacing issues.
Messaging Code | Generated Message |
---|---|
<SG:0> <DB:0> <TW:0> <TR:0> <QD:0> <OT:0> |
1 Double |
An alternative technique that can be used with 0 values is the use of Value Deletion discussed in more detail next.
Value Deletion
Tourplan has a technique called Value Deletion this is also know as removing blank text, and can be used to remove blank values too.
Using the tags <RMS:BL> and <RME:BL> (Remove Blank Lines Start and Remove Blank Lines End) Tags around a substitution code will remove the text if there is no content. This technique will only delete data content between the tags and will not delete the structure of the document.
An example could be when Supplier Address Fields usually use all 5 Address Fields, however not all Suppliers may need to have all fields used for their addresses. If we look at the Auckland City Oaks example below the message would generate with blank lines where Address Field 2, Address Field 3 and the Post Code are as there is no data in Tourplan to generate into the message.
Supplier Example | CODE | Message would generate |
---|---|---|
![]() |
<SN> <SA1> <SA2> <SA3> <SA4> <SA5> <SPC> |
Auckland City Oaks 188 Hobson Street
Auckland New Zealand |
If the Remove blank lines start and end tags <RMS:BL> <RME:BL> are applied around the address substitution codes above the message generation result would be:
Substitution Codes - Value Deletion | Message would generate |
---|---|
<SN> <RMS:BL><SA1><RME:BL> <RMS:BL><SA2><RME:BL> <RMS:BL><SA3><RME:BL> <RMS:BL><SA4><RME:BL> <RMS:BL><SA5><RME:BL> <RMS:BL><SPC><RME:BL> |
Auckland City Oaks 188 Hobson Street Auckland New Zealand |
Value Deletion within a Table
This technique can also be used inside a table and for non-numeric data where you only want the content to be deleted not the entire row.
Booking Name | <BN> | Travelling | <TD> |
<RMS:BL>Agent Confirmation | <UDTEXT1><RME:BL> | Agent | <AC> |
<RMS:BL> Special Requirements | <UDTEXT2> <UDTEXT3><RME:BL> | Consultant | <CON> |
If there is no content in UDTEXT2 field the message would generate as follows:
Booking Name | Smith Family x 4 | Travelling | 05/10/2019 |
Agent Confirmation | AG1019089 | Agent | ABC001 |
Special Requirements | Request a room by the pool. | Consultant | TPL |
If there was no content in UDTEXT3 field the message would generate as follows:
Booking Name | Smith Family x 4 | Travelling | 05/10/2019 |
Agent Confirmation | AG1019089 | Agent | ABC001 |
| Consultant | TPL |
This technique allows you to keep the Agent and Consultant Cells as well as the data generating for the cells to the right of the Travelling, Agent and Consultant column.
NOTE: If you are using Remove Blank Lines Tags <RMS:BL> <RME:BL> you must have a start and an end tag around the data you want the system to remove. Message errors can occur if a blank line start has no end tag or vice versa.
Row Deletion
The Row Deletion technique can be used in conjunction with Zero Flagging or with Value Deletion. Messaging Definition Templates use Microsoft Word Tables. The row deletion technique allows for a specific command to remove an entire row if there is no content or value.
NOTE: The Row Deletion tag <RMS:ROW> does not require an end tag.
Row Deletion is different to value deletion as the entire row will be deleted if there is no data present.
Booking Name | <BN> |
<RMS:ROW> User Text 1 | <UDTEXT1> |
<RMS:ROW> User Text 2 | <UDTEXT2> |
<RMS:ROW> User Text 3 | <UDTEXT3> |
<RMS:ROW> User Text 4 | <UDTEXT4> |
When the message generates it would output removing the rows where there was no text. The result would be:
Booking Name | Smith Family x 4 |
User Text 3 | Request a room by the pool |
Zero Flagging and Row Deletion
Zero flagging can be used in conjunction with either Row or Value Deletion. Using a combination of the techniques allows for sections of the generated message document to removed if the substitution code sourcing the information from Tourplan has a value of 0. The most obvious example of this is product extras.
The booking of product extras alters based on the clients requests. Some bookings may not have any product extras selected, whereas other bookings may have more than one product extra booked. The generated message is to alter based on the booking.
<RMS:ROW> <EX1> | <CUR> | <AGENT:EX1:0> | |
<RMS:ROW> <EX2> | <CUR> | <AGENT:EX2:0> | |
<RMS:ROW> <EX3> | <CUR> | <AGENT:EX3:0> | |
<RMS:ROW> <EX4> | <CUR> | <AGENT:EX4:0> | |
<RMS:ROW> <EX5> | <CUR> | <AGENT:EX5:0> |
If the an accommodation booking had selected Extra 3 which was a Cooked Breakfast, the message would generate as follows:
Cooked Breakfast | NZD | 35.00 |
The message would adjust and remove rows when extras were not booked.