Select element

Select element

In the designer there are two conditional elements: The If element and this, the select element. The select element is an advanced version of the If element, that makes it possible to branch out to different sub-folders with elements, depending on various conditions.

 

Click this icon to insert a select element:

 

NG2Select0001

 

The icon is found by clicking the '+' icon to reveal the second row of design elements:

 

NG2Select0002

 

You see the properties of the select element, when you create a new element and when you double click it in the element tree:

 

NG2Select0003

 

The functionality of the select is described below:

 

1.Add new expressions/branches.

2.How to delete expressions/branches.

3.How to rearrange/resequence branches.

4.Help for XPath conditions.

 

If you insert a condition for a spooled file, then you should consider to activate the relative mode and setup an anchor line to make it easier to use the ng:spoolMapRel function if needed.

 

 

How to add a new expression

With the blue icon: '+ ADD EXPRESSION' you can add new expressions/branches to the select element. In the example above this was pressed 3 times to add the 3 branches to the default one.

You state an Xpath expression for each branch, which is expected to return a boolean (true or false). You can click the magnifying glass on the right to get help to build up the Xpath expression with a reference to a sample XML file, variables and built-in functions.

 

The same select element looks like this in the element tree in the designer:

 

 

NG2Select0004

 

In this case a text is inserted for each branch. The contents of the text is different for each branch to reflect the actual branch.

 

 

 

How to delete a branch of the select element

There are two ways to delete a branch/expression of the select element:

 

1.You can click the garbage can to the right of the expression in the select properties.

2.You can delete the branch from the element tree view, if you select the branch and press the <Delete> key on your keyboard.

 

 

 

Reposition branches

When you look at the list of expressions/branches in the properties of the select element, then the sequence seems quite fixed, but it is actually possible to rearrange the branches of the select. To do that you simple go to the element tree and here you can simply drag branches to another position in the select list.

 

 

Help for Xpath conditions




    • Related Articles

    • If element

      It is possible to specify, that some design elements should only be included if a certain condition is met. For that you can use the If element as described below. A more advanced option is to use the select element. You can insert an If element with ...
    • Page break element

      There are several ways to force an extra page in the output: 1.Add an extra page element 2.An overflow of detail lines in the body of a page. 3.Insert a page break element in your template. This section covers the third option. You can insert a ...
    • Bookmark element

      You can make InterFormNG2 add a bookmark element in the output PDF with the design element, Bookmark element. The element only has an effect on merges into PDF. You can decide, if the bookmarks should be shown when the PDF file is opened and to which ...
    • Cell element

      When you insert a table element in the designer, then each block of the table is referred to in InterFormNG2 as a cell. There is no limit the the element types, that you can insert inside a cell; you can even insert a table in a cell. So most of the ...
    • Page element

      The page element in InterFormNG2 is the container of all the physical elements, that build up the output. A new template is created with a page element as you need that in order to generate any output at all. You insert an additional page element ...