0
Fixed

Strange behaviour of CSV connector export

Matthew Clark 12 years ago in CSV connector updated by anonymous 8 years ago 7

The CSV connector is exhibiting some strange behaviour when exporting. See below a file that was written to. Telephone is a multivalue string field in the connector schema - the rest are strings.

Key,Name,EmployeeID,Telephone,Email
13,Matthew Clark,1337,another@address.com,Unify.Framework.StringValue[]
19,Anthony Sheehy,1339,tony.sheehy@unifysolutions.net,Unify.Framework.StringValue[]
100001,Josef,100001,mail@maily.com,System.Collections.Generic.List`1Unify.Framework.StringValue

Telephone and email have seemingly switched value types. I am assuming this is why the string value array writing has appeared.


CSV Export User.png

On private string ConvertEntityToCsvRepresentation(IConnectorEntity sourceEntity) in the CsvConnector the expected file order is not taken into account when writing, which results in the order described.

Currently the order is defined by the current order in the schema, which is:

foreach (var field in Schema)

The required structure will need to be read in before writing, excepting headings that are not in the Schema.

As for the 'System.Collections.Generic.List`1Unify.Framework.StringValue' and 'Unify.Framework.StringValue[]', these are because the MultiValue ToString(IFormatProvider) implementation uses a simple Convert.ToString.

Moved to beta.

Tony, can you please fix up the multi value issue. I don't think MultiValue is the right place to do it. Probably just get a collection of values and string.Join the values string representations.

Please assign to Matthew for the schema order issue.

Thanks.

This has been fixed and just needs to be confirmed.

After some issues with locking on exports, i'm happy to confirm this, the multivalues are coming through successfully after fixing up the .ToString() call on the MultiValue IValue.

This is still happening as discussed.

closed following time.