Filling nested infotables in thingworx
Hi there,
I try in vain to fill a nested infotable in a js service. The DS is defined as follows:

Now I want to fill the infotable with data using this DS. I do this as follows:
var params2 = {
infoTableName : "InfoTable",
dataShapeName : "Absences_DS"
};
// CreateInfoTableFromDataShape(infoTableName:STRING("InfoTable"), dataShapeName:STRING):INFOTABLE(PersonioTimeOffTypesDS)
var it = Resources["InfoTableFunctions"].CreateInfoTableFromDataShape(params2);
for(let absence in json.data) {
let current = json.data[absence];
let newEntry = new Object();
newEntry.ID = current.attributes["id"];
newEntry.StartDate = current.attributes["start_date"];
newEntry.EndDate = current.attributes["end_date"];
newEntry.UpdatedAt = current.attributes["updated_at"];
newEntry.DaysCount = current.attributes["days_count"];
newEntry.CreatedBy = current.attributes["created_by"];
newEntry.Status = current.attributes["status"];
newEntry.Comment = current.attributes["comment"];
newEntry.Employee[0].Vorname = current.attributes.employee.attributes.first_name["value"];
newEntry.Employee[0].Nachname = current.attributes.employee.attributes.last_name["value"];
newEntry.Employee[0].ID = current.attributes.employee.attributes.id["value"];
newEntry.Employee[0].Mail = current.attributes.employee.attributes.email["value"];
newEntry.TimeOffType[0].Typ = current.attributes.time_off_type.attributes["name"];
newEntry.TimeOffType[0].ID = current.attributes.time_off_type.attributes["id"];
it.AddRow(newEntry);
}
I get the following error message:
Error executing service getTimeOffTest. Message :: TypeError: Cannot read property "0" from undefined - See Script Error Log for more details.
What am I doing wrong here? Why does this not work?
I hope for help!
Greetings
Chris



