IMPORT from a BO Document Attribute

If you have questions or if you want to share your opinion about Aware IM post your message on this forum
Post Reply
PointsWell
Posts: 1457
Joined: Tue Jan 24, 2017 5:51 am
Location: 'Stralya

IMPORT from a BO Document Attribute

Post by PointsWell »

Is it possible to import the contents of a BO Document Attribute?

For example

BO called ImportObject has a single attribute "ImportObject.CSVFile"

Is it possible to import the contents of that CSV file or does it have to be imported from the file system.
ACDC
Posts: 1138
Joined: Sat Jun 30, 2007 5:03 pm
Location: California, USA

Re: IMPORT from a BO Document Attribute

Post by ACDC »

You can use URL_CONTENTS to do this
example:
Object.CsvContent=URL_CONTENTS('file:///C:/Folder/<<Object.ID>>.csv')
PointsWell
Posts: 1457
Joined: Tue Jan 24, 2017 5:51 am
Location: 'Stralya

Re: IMPORT from a BO Document Attribute

Post by PointsWell »

Rereading I realise my original post wasn’t clear.

The user creates ImportObject and uploads a file from their local file store.

I then have a BO with a document in it. I’d like to just IMPORT xyz From ImportObject.DocumentAttribute

I’ve tried downloading the document to the server file store but I’m having very poor results (ie none).

Then I thought I’d not store the CSV file in the database and instead specify a file location for it but read that Jaymer had had problems with relative file positions.

Then I stopped and went back to more productive work...
ACDC
Posts: 1138
Joined: Sat Jun 30, 2007 5:03 pm
Location: California, USA

Re: IMPORT from a BO Document Attribute

Post by ACDC »

Yeah, I dont know about from within an Object

But why can't you export the CSV file in the Document Attribute to a location and then use URL_CONTENTS to extract the contents to another Object.CSV attribute ( I do this a lot in one of my apps)

make it part of the same process e.g.

EXPORT ....C:/Folder/<<Object.ID>>
Object.CsvContent=URL_CONTENTS('file:///C:/Folder/<<Object.ID>>.csv')
Jaymer
Posts: 2430
Joined: Tue Jan 13, 2015 10:58 am
Location: Tampa, FL
Contact:

Re: IMPORT from a BO Document Attribute

Post by Jaymer »

The relative paths were reported and acknowledged as a bug - that Vlad resolved.
I have not tried it since - having worked around it.

As usual, the Server/Tomcat windows are your friend - as are Logger and the new LOG2 for debugging.
And I think people too often forget about doing a browser "Inspect" AND examining the console for a JS error.

jaymer...
Click Here to see a collection of my tips & hacks on this forum. Or search for "JaymerTip" in the search bar at the top.

Jaymer
Aware Programming & Consulting - Tampa FL
Post Reply