var oneLine = data.extract(1,200,0,1,“”).split(“|”);
var rec;
switch (oneLine[0]){
case “01”:
record.set({OrderNumber:oneLine[1],CustomerPO:oneLine[2],CustomerNumber:oneLine[3],Date:oneLine[4]});
break;
case “02”:
record.set({Company:oneLine[1],StreetAddress:oneLine[2],City:oneLine[3],State:oneLine[4],Country:oneLine[5],ZipCode:oneLine[6]});
break;
case “03”:
record.set({ContactFirstName:oneLine[1],ContactLastName:oneLine[2],ContactPhone:oneLine[3],ContactEmail:oneLine[4]});
break;
case “04”:
var index= record.tables.products.addRow({Number:oneLine[1],Description:oneLine[2],UnitPrice:oneLine[3],Ordered:oneLine[4],Shipped:oneLine[5],BackOrder:oneLine[6],Total:oneLine[7]})
record.tables.products[index].set()
break;
case “05”:
var index1= record.tables.test.addRow({Number:oneLine[1]});
record.tables.test[index1].set()
break;
Can you let us know please if the detail table “products” does exist in your Data Model? If so, please note that the addRow method can only addadds a record to an existing detail table.
Hi @mkamel, Thank you for sharing the Data Mapper.
I can see that the record table “test” does exist in the Data Model. I assume that, based on the shared Data Mapper, you cannot use the method “addRow” in one Repeat Step > Action Step when you try to add a row detail table “products” or detail table “test” in the same Repeat Step plus Action Step. Because I can see that the preview/result of typing “record.tables.test.” becomes “UniqueTag” instead of “Array” when you type this line of code after the following line of code has been executed (“Apply script”):