I am using the below code to add a row to the existing collection, but it is giving me error.
Please advise what correction should I do to achieve this:
Clear(colSvcExportData);
ForAll(
SupportSvcGallery.AllItems As SvcExportData,
Collect(
colSvcExportData,
{
RecoNo: SvcExportData.RecoNo,
SvcDate: Text(SvcExportData.SvcDate,"dd-mm-yyyy"),
Model: SvcExportData.Model,
SerialNo: SvcExportData.SerialNo,
SvcSMR: SvcExportData.SvcSMR,
SvcRemarks: SvcExportData.SvcRemarks,
SvcExpense: SvcExportData.SvcExpense,
Customer: SvcExportData.Customer
}
)
);
//Below code to collection 1 row of total at the end
Set(
colSvcExportDataAddRow,
{
RecoNo: "Total",
SvcDate: " ",
Model: " ",
SerialNo: " ",
SvcSMR: " ",
SvcRemarks: " ",
SvcExpense: Text(Sum(SupportSvcGallery.AllItems,SvcExpense),"##,##0.00"),
Customer: " "
}
);
//below code to Union/Join with main collection and last row
Collect(
colSvcExportData,
{
RecoNo: colSvcExportDataAddRow.RecoNo,
SvcDate: " ",
Model: " ",
SerialNo: " ",
SvcSMR: " ",
SvcRemarks: " ",
SvcExpense: colSvcExportDataAddRow.SvcExpense,
Customer: " "
}
);