HomeGuidesRecipesAPI
HomeGuidesAPILog In

Gap Bookmarks

Gap Bookmarks

This is a bookmark that will be removed from the generated document if the question has no value.

This is useful for clearing irrelevant text if an answer is not provided.

For example, if the user does not provide a value for Address Line 2 the redundant line may be removed from the document using a gap bookmark.

No Gap Bookmark on Address Line 1 (Mandatory)

639

Gap Bookmark (Type 1)

640

Gap Bookmark – Type 2

There is also another type of Gap Bookmark.

If the bookmark name is used as the bookmarks gap bookmark (same name), and if there is no data coming through to the answer it will then rip out the bookmark as well as the rest of paragraph.

Gap Bookmark (Type 2)

637

Using Gap Placeholders or Auto logic to remove unwanted content

Often, particularly when using a data source it is necessary to remove an unwanted word, sentence etc. This can be achieved using a gap placeholder or auto logic question.

In the example below the text ‘and my favorite color is MYCOLOR’ will be removed if there is no color present in the database.

My name is Joe and my favorite color is MYCOLOR.

It is necessary to place a bookmark, for example, OpeningSentence_MyCol around the MYCOLOR part of the sentence that clearly acts as a placeholder for the color if it exists. See image below:

407

Now create another bookmark, for example, OpeningSentence_MyCol_Text that marks the area to be removed if a color is not present in the data source. See image below:

431

Technique 1 Gap Placeholder

This is the more traditional approach where SmartIQ detects that a value has resolved to ull, nothing and empty. and proceeds to remove a nominated bookmark known as the gap placeholder.

To set a gap placeholder, left click on the answer and navigate to the placeholder tab. Click on the arrow button near to the Gap Placeholder as shown in the image below, that will automatically select an appropriate

placeholder to remove if there is no value present. In our case, OpeningSentence_MyCol_Text will get selected.

656

Auto Logic

This technique involves using an auto logic question to remove the text if the value resolves to null, nothing and empty.

Add an auto logic question and create rules on auto logic answer using Rules tab only to insert the placeholder, in our case OpeningSentence_MyCol_Text if the value is not equal to “”.

726

📘

Notes:

*The example uses a data source question but the technique applies to many other question types such as user prompt or variable.

*Be sure that this placeholder covers any leading or trailing spaces, so they are not unintentionally left or removed. In the example above a leading space is included in the outer placeholder but not the trailing full stop

*For gap placeholders, it is possible to use the placeholder bookmark as the gap placeholder, beware that the entire paragraph will be removed if the gap placeholder is triggered rather than a portion of it.

Gap bookmarks within a repeating section

Gap bookmarks within a repeating section will cause the rest of the document to not generate/cause errors if the gap bookmark ends on its bookmark.

For example:

[Address [AddressLine2]

This will cause an issue if there is no AddressLine 2.

To fix this issue, add a single "space" after the AddressLine2 bookmark and use that for the gap bookmark.

For example:

[Address [AddressLine2] ]

Gap placeholder

Gap placeholder is a placeholder that will be removed from the generated document if the question has no value. This is useful for clearing irrelevant text if an answer is not provided.

For instance, When there is a situation of a multi-line data block, such as an address, a Gap Placeholder allows empty lines in the address block to be removed in the final output – thus presenting a neater representation in the final document.

During the assignment of Placeholders, a situation may arise as depicted by the image below. In this case, there are two Placeholders, "Address" and "Address_Gap", which are available for assignment:

293
  1. Select the first Placeholder( for example "Address") and assign it to an appropriate "Answer".

  2. Click to select assigned placeholder and navigate to placeholder "Properties" tab.

  3. Click the arrow button next to "Gap Placeholder:" property. As shown in the following image:

643
  1. This will automatically select an appropriate Placeholder to remove if there is no value present. In our case, "Address_Gap" will be selected as a Gap Placeholder.
645