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

Community Tip - Did you get an answer that solved your problem? Please mark it as an Accepted Solution so others with the same problem can find the answer easily. X

I am getting access denied error while Reading CSV file

mlohokare
5-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

ACCEPTED SOLUTION

Accepted Solutions
nkhose
12-Amethyst
(To:mlohokare)

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
nkhose
12-Amethyst
(To:mlohokare)

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 !

mlohokare
5-Regular Member
(To:nkhose)

Hi Nilesh,

Thanks.

Now I am able to read my csv file.

Regards,

Mahesh

Hi Mahesh,

Could you load the content to grid???

Regards,

Hariprasadh

mlohokare
5-Regular Member
(To:hpanchamoorthy)

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

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.

mlohokare
5-Regular Member
(To:hpanchamoorthy)

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

Thank you so much!!

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!

nkhose
12-Amethyst
(To:mvolanti)

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

Thank you Nilesh.

Tomorrow i will try it.

Hi Maurizio,

How did you resolve this issue : "Unable To Convert From java.lang.String to NUMBER". I am facing the same issue but couldn't find any workaround?

Can you please tell me what solution you have applied. I have float values in my CSV file and I have Number columns in DataShape but I keep receiving this error.

Regards,

Neetu

Announcements


Top Tags