Nilesh Patil
06/23/2022, 2:57 PMbattk
06/23/2022, 3:31 PMbattk
06/23/2022, 3:32 PMMarvin
06/23/2022, 5:15 PMNilesh Patil
06/24/2022, 7:28 AMNilesh Patil
06/24/2022, 7:29 AMMarvin
06/24/2022, 5:30 PM/**
* @NApiVersion 2.1
* @NScriptType ScheduledScript
*/
// eslint-disable-next-line no-undef
define(['../cafb-scripts/modules/papaparse.min'],
/**
* @param Papa
*/
(Papa) => {
As far as loading it into a suitelet you can do that through a JSON object for manipulation. Then convert back to CSV using Papa Parse.Marvin
06/24/2022, 5:38 PM@NAmdConfig ./JsLibraryConfig.json
but I have never got it to work.Nilesh Patil
06/27/2022, 11:41 AMNilesh Patil
06/27/2022, 11:42 AMdefine(["N/file"], function (f) {
/**
* Custom module for executing N/file cookbook examples
*
* @NApiVersion 2.0
* @NModuleScope SameAccount
*/
var exports = {};
function readFile(response) {
var weatherFile = f.load({id: "SuiteScripts/weather.csv"});
var weatherData = [];
weatherFile.lines.iterator().each(function (line) {
var w = line.value.split(",");
weatherData.push({date: w[0], low: w[1], high: w[2]});
return true;
});
response.write({output: JSON.stringify(weatherData)});
}
exports.readFile = readFile;
return exports;
});