Using Gap Placeholders or Auto logic to remove unwanted content

Applies to Infiniti v8.1 or later

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 favourite color is MYCOLOR’ will be removed if there is no colour present in the database.

My name is Joe and my favourite 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 colour if it exists. See image below:

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

Technique 1 Gap Placeholder

This is the more traditional approach where Infiniti detects that a value has resolved to null, 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.

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 “”.

Hints and Tips:

  • 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.

Related Articles

 

Keywords

autologic