Skip to main content
May 1, 2018 12:12 AM UTC
Question

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

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);

7 replies

May 1, 2018 5:52 AM UTC

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 .

May 1, 2018 5:12 PM UTC

 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 

May 2, 2018 7:30 AM UTC

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