Skip to main content
8-Gravel
May 1, 2018
Question

Getting empty return when using Resources["CSVParserFunctions"].ReadCSVFile(params);

  • May 1, 2018
  • 1 reply
  • 3767 views

I have a simple CSV file with content like below.

Date,PCSN,Total
4/27/2018,H192857,3
4/27/2018,H193177,4
4/27/2018,H193100,20

 

I'm using CSVParser_Extensions v4.0.1, but keeps getting empty returns with the following code. Really appreciate any help on this.

 

var sFile = "PMP/test1.csv";

var params = {
path: sFile /* STRING */,
columnMappings: 'Date;PCSN;Total' /* STRING */,
hasHeader: true /* BOOLEAN */,
longitudeField: undefined /* NUMBER */,
dateFormat: "dd.MM.yyyy" /* STRING */,
fileRepository: me.name /* THINGNAME */,
latitudeField: undefined /* NUMBER */,
fieldDelimiter: "," /* STRING */,
stringDelimiter: "\"" /* STRING */,
dataShape: "VMS.CSV.Test" /* DATASHAPENAME */
};

// result: INFOTABLE
var result = Resources["CSVParserFunctions"].ReadCSVFile(params);

1 reply

5-Regular Member
May 1, 2018

I will doubt about fileRepository parameter value ,why you have inputted me.name there ? I think fileRepository is a ThingName where the file is located .Like for example "SystemRepository" .What is me.name here ,i think its the current thing name you have place .Can you please check this and retry .

8-Gravel
May 1, 2018

 Thank you for responding my issue, mnarang

I'm writing the service on a FileRepository thing, me.name is the ThingName. I tried to use hard-coded ThingName, same problem, still getting the emplty return.

 

Thanks,

Wendy 

5-Regular Member
May 2, 2018

I tried the same thing and it is working fine .Can you also try running this service from the Composer only ?

And see if any error is coming while executing the service manually .See the attached executed sample at my end