Nested tables and the group attribute
As we saw in Exercise 12: Appending data to a table, the Import Tool does not know the relationship between columns. This is of particular issue when building a CSV Import data file: when we attempt to append more than one row to an outer table (Tasks in this example) and specify data for inner (nested) tables, we can end up with identical Column headings in the Import data file. As we have seen, the solution is to employ the Group
attribute.
- Modify
exercise14_train1.csv
(whereTrain1
is your login name) as follows:
Column Name (Row 1) |
Record 1 (Row 2) |
---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
As we have seen, to ensure that there are no issues with the alignment of rows we must include all relevant rows in our Import data file:
TasTaskAssignerRef_tab(+ group='1').NamLast
TasCommencementDate0(+ group='1')
TasStartNotifyDate0(+ group='1')
TasCompleted_tab(+ group='1')
TasTimeTakenOnTask_tab(+ group='1')
TasCompletionDate0(+ group='1')
TasEndNotifyDate0(+ group='1')
TasCompletionNotifyRef_nesttab(+ group='1':1).NamLast
Note: In this exercise, as we're not adding any values to these columns for group 1 or 2, there's no need to include them in the Import data file. If we were including values for these fields for group2, we would have to include these columns for both groups 1 and 2, even if we had no values for these fields in group 1.
Note:
Note that the Group
attribute always follows the update modifier +.
- Save the file and perform a Typical import.
When successful, your updated record will be similar to:
The
Group
attribute ties the related columns together, ensuring that the inner able values are associated with the correct outer row.