Insert field data on each row of uploaded and parsed content

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?

  1. fileContent = input.Cruise_Sales_Upload.content;
  2. rowlis = fileContent.toList("\n");
  3. i = 0;
  4. for each  rl in rowlis
  5. {
  6. if(i > 0 && i < rowlis.size() - 1)
  7. {
  8. lis = rl.toList();
  9. ppstfNewRecordID = insert into Preferred_Partner_Sales_Totals_Form
  10. [
  11. Added_User=zoho.loginuser
  12. Supplier_Sub_Type=lis.get(0)
  13. Company_Name=lis.get(1)
  14. Cruise_Sales_2023=if(lis.get(2).tostring() == "",0,lis.get(2).todecimal())
  15. Cruise_Sales_2022=if(lis.get(3).tostring() == "",0,lis.get(3).todecimal())
  16. ];
  17. //fetch ppstf recird
  18. ppstfRecord = Preferred_Partner_Sales_Totals_Form[ID = ppstfNewRecordID];
  19. //
  20. 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)
  21. {
  22. //
  23. delete from Preferred_Partner_Sales_Totals_Form[ID = ppstfNewRecordID];
  24. }
  25. }
  26. i = i + 1;
  27. info rowlis;
  28. }