How can we help?

Search for answers or browse our knowledge base

< All Topics
Print

Multi-tab

Principle

The multi-tab compartment allows one or more tabs of a form to be duplicated along a data breakdown axis. The operation of the multi-tab compartment can be compared to the pattern compartment in that a basic structure of the document will be duplicated, and it will be possible to authorize the user to add/delete items in GTAnswer.

Construction

Consider the following questionnaire:

Formulaire d'origine

 

 

It contains only one tab, “Form,” on which 4 components are positioned.

 

 

 

 

 

 

 

We wish to feed it with this table:

Table de données

Each recommendation is identified by the “Risk” field.

The “Subsidiary” field will be our distribution axis. Without the multi-tab, each respondent assigned to a subsidiary would receive as many documents as there are rows mentioning their subsidiary (2 for “Headquarters”, 2 for “Switzerland”, 3 for “UK”.

The addition of the multi-tab will allow us to send only one document, containing as many sheets as there are items in the “Risk” field for a given subsidiary.

In Design

By default, the structure of the document is as follows:

The 4 fields of the document are all located at the root.

To add the multi-tabs, simply right click on “Multi-tabs” and choose “Add a multi-tab” from the pop-up menu:

 

 

You then chose your multi-tab axis: this is the field in the feed table that will generate the sheets. As we wish to create a sheet for each item in the “Risk” field, it is the name of this field that must be entered.

You can now set up your multi-tab. First of all, you must determine which tabs of the document will be duplicated.

 

 

 

 

Here, our document has only one sheet, “Form”. So we will select it and click on the “Add Sheets” button. “Form” is then moved to the list of sheets in the multi-tab axis.

As our multi-tab will be read-only (we don’t want users to be able to add or remove sheets), we will leave the other options as default.

 

 

 

 

 

The compartment tree is updated. Note that, as all 4 components of the document are now in the multi-tab, the root is empty.

 

 

 

 

 

 

 

You can see that the “Form” tab now has an icon symbolizing a multi-tab. This icon will appear on all sheets of a document included in a multi-tab.

To check that the multi-tab duplicates the desired sheets, click on the preview button (or press F12)

 

 

 

 

 

 

 

 

The document is then opened in GTAnswer. In the absence of feed data, 3 tabs are generated for each group of multi-tabs.

 

 

 

 

 

Note that, since the “Risk” field is the axis of the multi-tabs, it is this field that receives 3 records labeled by the field name + number. So here we have Risk1, Risk2 and Risk3.

In GTAnswer

Unlike a pattern, it is impossible to leave a multi-tab compartment “empty” in a launch action. Indeed, while a pattern may not use a key, a multi-tab always has a key: the multi-tab axis, which cannot be empty.

In the publication action data, we, therefore, assign the data table to the multi-tab compartment.

 

Note that the compartment displays 4/5 because the “Subsidiary” field is not present in the compartment.

Once the action has been executed , each document (here, that of the subsidiary “Headquarters”) displays as many tabs as there are items in the “Risk” field for this subsidiary.

 

 

Note 1: each tab is labeled with the associated “Risk” field.

Note 2: the labels are sorted here, but this is random: it is the order in which they appear on the table. To ensure that the items are sorted, they must be sorted in the compartment.

 

 

 

Multi-tab read/write

It is possible to allow the user to add/remove sheets. By default, when the user adds a sheet, a dialog box will be displayed asking him to enter the name of the new sheet. This name will be a new item added to the multi-tab axis.

It is also possible to restrict the name of the sheets created by a list of items. To do this, use a pattern containing the list of allowed items and enter the name of the pattern field containing the items in the “Item Source Header” property of the multi-tab. In this case, when the user adds a new sheet, a drop-down list containing the allowed items will be displayed, from which the user will have to choose the sheet name.

When a multi-tab item is created or renamed by the correspondent, this item is written into the component with the same name as the multi-tab group: this component must be controlled with a text format.

A sheet which is part of a dynamic multi-tab should only contain editable components or controls containing formulas (with the sole exception of the control with the same name as the multi-tab group).
When a sheet is added, a control component that does not contain a formula will have an empty value (except for the control with the same name as the multi-tab group).

The list of all multi-tab items can be extracted with a GTMs.CONCATENER function.

Note: Since it is not possible not to add items to a multi-tab (there must always be at least one sheet), if you wish to create a multi-tab dedicated solely to adding items, add a single item to the multi-tab (for example, “DUMMY”, “To be deleted”…). If your multi-tab uses the “Item source header” property, the user will be obliged to delete this sheet because it will not be part of the authorized items list. If you do not use this property, you can use the GTCONTRAINTE function to prevent the transmission of a response with this sheet.

 

Was this article helpful?
0 out Of 5 Stars
5 Stars 0%
4 Stars 0%
3 Stars 0%
2 Stars 0%
1 Stars 0%
How can we improve this article?
Please submit the reason for your vote so that we can improve the article.
Previous Transposition
Next Pattern and Transposition
Table of Contents