[Csv] Discussion

[Csv] Discussion

Forge Component
Published on 2011-04-07 by Paulo Tavares
8 votes
Published on 2011-04-07 by Paulo Tavares
I've added a few optional parameters to give the extension more flexibility ...

* delimiter - choose an arbitrary string as field delimiter (defaults to comma)
* showHeader - show/hide the header line (defaults to true)
* quoteEmptyFields - put quotation marks even around empty fields (defaults to false)

Hope that's useful to someone :)

- Stefan
Hi Stefan.

Great stuff - thanks for feeding the new features back to the community! I'm sure they'll come in handy to many. :)

I took the liberty of adding you to this component's developer team - if you want to publish a new version with your component, it might make it more visible and available for everybody. Otherwise, we'll wait for the component owner - Mário - to do it himself.

Congrats, and keep it coming!

Paulo Tavares
Thanks Paulo,

I have released the new version of the extension.

Hi Stephen,

This is cool stuff, thank you for taking the time to do this!

Hi Stefan,

I've just tried the CSV component and I'm not getting the results expected :( I get a text file with the right number of lines and the right number of columns per row. However, the content of each "cell" in a row is not the expected one. Here is an example of what i get:

I guess the problem is in the value I pass to the input parameter RecordList of the RecordListToCsv action. I'm passing the following: ToObject(TableRecords.List).

Thanks in advance,

Hi Pedro.

Could you give us an example of the file content you're inputting, what method are you calling, and what result were you expecting?


Paulo Tavares

the CSV extension expects a record structure that consists of basic datatypes (Text, Integer, Decimal). If your record structure contains complex objects the extension does not inflect on these objects and thus returns the object name rather than the value you were expecting.

What i the structure of the record that you're feeding to the extension?

- Stefan
Hi Paulo & Stefan,

thanks for your prompt reply. I'm sending the eSpace I'm using in attach. This is part of the MyContacts application used in the "Developer Course I". Maybe the problem has to do with the fact that one of the fields has a "Phone Number" type.


I can reproduce your error on the 5.0 community edition. I'm developing on version 4.2/Java, and I've rebuilt your example on that environment and it does not show the error. Possibly an error introduced when the extension is upgraded? I only have VisualStudio 2005 available, so unfortunately I can't verify that.

Maybe anyone from the .NET community can shed more light into this ...

- Stefan

I have tried the eSpace in a 4.2 .Net platform version and everything went OK, maybe this is a breaking change.
I'll check it out and get back to you when I have more information.

Best regards,
Renato Gonçalves

Here goes an updated version of the extension that works with 5.0.
There's a breaking change on the code generated for the structures, containing some fields that need to be excluded.
Only changed the .NET version... I don't have a Java platform ready right now :(

Hope it helps.

Thanks, Gonçalo

the Java platform isn't at release 5.0 yet anyways :) ... I'll be updating the Java part for 5.0 once that version becomes available.

Thanks to all.

I've tried using this extention in, same error as before when downloading the CSV content.

Hi Louis, Stefan,

The 5.0/5.1 version I uploaded at 01.05.10 was not the correct one! probably picked the old xif from disk.

The attached one is the correct version (in 5.1).
Louis, you should try with this one, it is working :)
This one works like a charm! all you need to do is do the IPP thingy :)
I've added a new optional parameter:

- RemoveQuotes: Removes quotation marks in all fields (is False by default). If True, QuoteEmptyFields is ignored.

e.g: "text" -> text

Nuno Palhinhas
Very grateful Nuno!!
Hi all,

I just updated the official extension version with the latest one that has been contributed by Nuno.

Thanks for your help in improving this component!


Paulo Tavares
I have not had any luck using the java version and have the same type of errors as Louis mentions above. I then tried the .net version and it worked for me on the community edition.  I then noticed that Goncalo mentioned that he updated the .net version but did not update the java version to correct the errors Louis mentiond.  Is the java version to be updated soon?

Thanks for any responses,

Wayne Hodgson  
I made an attempt and was successful at correcting the java version.  I did not make any changes to the .net version, so the attached version should work for either one.  I hope this helps someone else.

Wayne Hodgson  
After some additional tests, I found a logic error when using structures that has been corrected in the java version. Again, I did not make any changes to the .net version, so disregard the previous post attachment and use this attachment.

Wayne Hodgson
Hi Wayne,

Thanks for the feedback. Next week I'll give a look at the changes and add a new version of the component.

João Portela
Hi João,

Can you upload that new version? :)
The latest version seems to have IPP locked (http://www.outsystems.com/forums/discussion/11711/foreign-module-error-when-publishing-in-personal-environment/).

Thanks in advance!
Hi  Wayne,

I gave a quick look at your changes, and it looks like it still needs some minor changes. 
Also, the part of the java code is doing different stuff (comared to .net).

So, could you please send me a sample espace with reported problems?

I have encountered the following problem with the csv conversion. I have a structure with about 6 fields (text or decimal). Simplified the structure has following records before I call RecordListToCsv, [x] depicting a record:
[0] Erik ,[1] Paul,[3] Joost, [4] Paul, [5] Imelda, [6] Ton
After calling RecordListToCsv the structure is:
[0] Ton, [1] Paul, [3] Joost, [4] Paul, [5] Imelda, [6] Ton
Effectively replacing [0] with [6].
The full structure is:
PersonName     text
Taskname           text
Startdate             text
StartTime            text
EndDate               text
EndTime              text
NumberOfDays Decimal
Remarks              text
Status                   text
I have also other actions that use RecordListToCsv that don’t have this phenomenon. Anyone seen this behavior before?

using the latest version for csv and using Service Studio
To clarify I have added a document with some screen shots...
I found the solution. It has nothing to do with the csv extension, but everything with adding a record to the record list. I used HolidayRequests.current.ExcelAssignmentLine.PersonName to add a record. Using the list itself to add records creates a pointer problem. I changed this to use a local variable to add items to the list.
    have you any version which is compatible with Version

Rajendra Singh