Insert field data on each row of uploaded and parsed content
Hi,
On the upload and parse content below, I want to insert data into each row that I need on the parsed input to the other form so the data can be grouped by this field, but it can't be on the uploaded .csv.
How can I do this?
- fileContent = input.Cruise_Sales_Upload.content;
- rowlis = fileContent.toList("\n");
- i = 0;
- for each rl in rowlis
- {
- if(i > 0 && i < rowlis.size() - 1)
- {
- lis = rl.toList();
- ppstfNewRecordID = insert into Preferred_Partner_Sales_Totals_Form
- [
- Added_User=zoho.loginuser
- Supplier_Sub_Type=lis.get(0)
- Company_Name=lis.get(1)
- Cruise_Sales_2023=if(lis.get(2).tostring() == "",0,lis.get(2).todecimal())
- Cruise_Sales_2022=if(lis.get(3).tostring() == "",0,lis.get(3).todecimal())
- ];
- //fetch ppstf recird
- ppstfRecord = Preferred_Partner_Sales_Totals_Form[ID = ppstfNewRecordID];
- //
- if(ppstfRecord.Company_Sub_Type = "Cruise Line" && ppstfRecord.Cruise_Sales_2023 = null && ppstfRecord.Cruise_Sales_2022 = null && ppstfRecord.Cruise_Sales_2020 = null && ppstfRecord.Cruise_Sales_2021 = null)
- {
- //
- delete from Preferred_Partner_Sales_Totals_Form[ID = ppstfNewRecordID];
- }
- }
- i = i + 1;
- info rowlis;
- }