Unable to open file using CSV Parser ReadCSVFile method
- September 28, 2019
- 1 reply
- 1455 views
Hi ,
I am trying to read data from CSV using ReadCSVFile from CSV Parser Extension snippets.
I am getting below error while am trying to read data.
Error executing service importUserNames. Message :: Unable To Open [TestName.csv] in [SystemRepository] : Index: 2, Size: 2 car- See Script Error Log for more details.
Can someone help me in resolving this issues.
Here is service code and attaching sample CSV am trying to upload.
var params = {
path: fileName /* STRING */,
columnMappings: 'Name;FullName;Password' /* STRING */,
hasHeader: true /* BOOLEAN */,
fileRepository: "SystemRepository" /* THINGNAME */,
fieldDelimiter: "," /* STRING */,
dataShape: "ImportUsers" /* DATASHAPENAME */
};
// result: INFOTABLE
var result = Resources["CSVParserFunctions"].ReadCSVFile(params);
for(var i=0;i<result.length;i++)
{
var params = {
password: result[i].Password /* STRING */,
name: result[i].Name /* STRING */,
description: result[i].FullName /* STRING */
};
// no return
Resources["EntityServices"].CreateUser(params);
};

