cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

I am getting access denied error while Reading CSV file

SOLVED
Regular Member

I am getting access denied error while Reading CSV file

Hi,

I am getting access denied error while reading CSV file.

Steps Perform to reach this,

  1. Created a Thing
  2. Created a DataShape
  3. Imported CSV extension
  4. Click on Magnifier
  5. Go to services
  6. Click on "ReadCSVFile --> Test"
  7. Copied CSV file to "ThingworxStorage\repository\GetCSVDetails"
  8. Fill below items
    1. fileRepository
    2. dataShape
  9. Click on "Execute Service"

After that I am getting Error as

"Unable To Open [/] in [GetCSVDetails] : \ThingworxStorage\repository\GetCSVDetails (Access is denied)"

Attached is the screen shot.

Regards,

Mahesh Lohokare

1 ACCEPTED SOLUTION

Accepted Solutions

Re: I am getting access denied error while Reading CSV file

Firstly you check the csv file resides in the repository thing you created using the service  GetFileListing to male sure

Then to test ReadCsvFile you need to set correct path .. i think you are giving the whole path as like

repository/Repositorything/store  instead you give path  /store/Book6.csv and give it a go !


Hope this helps !

View solution in original post

11 REPLIES 11

Re: I am getting access denied error while Reading CSV file

Firstly you check the csv file resides in the repository thing you created using the service  GetFileListing to male sure

Then to test ReadCsvFile you need to set correct path .. i think you are giving the whole path as like

repository/Repositorything/store  instead you give path  /store/Book6.csv and give it a go !


Hope this helps !

View solution in original post

Re: I am getting access denied error while Reading CSV file

Hi Nilesh,

Thanks.

Now I am able to read my csv file.

Regards,

Mahesh

Re: I am getting access denied error while Reading CSV file

Hi Mahesh,

Could you load the content to grid???

Regards,

Hariprasadh

Re: I am getting access denied error while Reading CSV file

Hi Hariprasadh,

I am able show my CSV data into grid on Mashup with onload.

It was dummy data and can be viewed as attached image here.

CSV-Data-MashUp.jpg

Regards,

Mahesh

Re: I am getting access denied error while Reading CSV file

Exactly Mahesh... This is what I wanted... Can you please explain how you passed the data from csv service to grid.(Javascript service). Coz, I got exceptions like datashape must be specified.

Re: I am getting access denied error while Reading CSV file

Hi Nilesh,

whn i try to read my csvfile as you said appears to me:

Unable to Invoke Service ReadCSVFile on CSVParserFunctions : Unable To Convert From java.lang.String to NUMBER



Do you know why?

Than's so much!

Re: I am getting access denied error while Reading CSV file

Hi,

I followed below steps,

  • Create a Thing
  • Create a Datashape
  • Create a Service under thing

          Set Local (JavaScript)

          Base type - Infotable

          DataShape - Shape name

          Infotable type - Just Infotable

          Use CSVParserFunction

          in Script Area I have written as below -

var params = {

  path: "/test.csv" /* STRING */,

  columnMappings: undefined /* STRING */,

  hasHeader: undefined /* BOOLEAN */,

  longitudeField: undefined /* NUMBER */,

  dateFormat: undefined /* STRING */,

  fileRepository: "GetCSVDetails" /* THINGNAME */,

  latitudeField: undefined /* NUMBER */,

  fieldDelimiter: undefined /* STRING */,

  stringDelimiter: undefined /* STRING */,

  dataShape: "GetCSVDataShape" /* DATASHAPENAME */

};

// result: INFOTABLE dataShape: "undefined"

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

  • Create a Mashup

          Add Grid

          Add Entity

          Assign All Data to Grid with Mashup Loaded property

Note: I have kept my CSV file into following location

"DRIVE:\ThingworxStorage\repository\GetCSVDetails\File"

Hope this will help you.

Regards,

Mahesh

Re: I am getting access denied error while Reading CSV file

Hey

First you check all the fields in datashape you have binded (mapping) are of same type (same name as header as well as type) to the field which

you are parsing through ReadCSVFile follow this Keri Wright​ suggested solution . In this case the error you are facing is the type error

of the datashape fields you have binded to the data which is coming through CSV ,one of fields of CSV field is string type but you have binded the field as

number(Base Type)

If you are still facing the problem, you may try to store a simple CSV in repository and then bind datashape of same fields and give it a go  ! Let me know for any help

Re: I am getting access denied error while Reading CSV file

Thank you so much!!