Community Tip - New to the community? Learn how to post a question and get help from PTC and industry experts! X
Hello,
CSV plugin allow to write CSV files using Infotable with specific Datashape. There isdocumentation on the market place, but procedure describe does not work really. In fact wirteCSV function does not wirte column in the same order as describe inthe DataShape .... if my fields in the datashape are : ID, Height, Age, CSV write function will write Height, ID, Age .. Do you know some workaround ?
Many Thanks
Brice
Hi,
Actually I have a ticket support for this issue. The column order of InfoTable and the DataShape are not the same.
By the way, can you please export your DataShape to .xml, open it and look at the "FieldDefinition" order ? In my case, the InfoTable column order follow this "FieldDefinition" order.
Hi,
In My case the infoTable column order does not follow the field definition order :
Cheers,
Brice
Hi,
I mean the column order of the InfoTable returned by the CSVwrite function.
Hi,
i did some investigation related bug.
You must use an INFOTABLE return in the service which generate the CSV, below code works good (with good datashape order in the CSV) :
Not clearly mentionned in the CSV pluggin documentation.
If you don't use return, CSV is generated, but not in the good order of the Datashape.
You can see that, by default, the InfoTable column order follow the field definition order: TestDateTime, Height, ID, Gender, Age. Even if these field are reordered in the DataShape, the result does not change. I tried your method with a query (QueryPropertiesHistory, QueryNamed...) but it doesn't work
Another question : the header of the CVS files is based on the name of the Datashape Fields ... Naming convention is very restrictive .. you can't add number in the name . i need number and special characters in my CSV column name, for Example "3. Gender" .. how to do that ?
Thanks very much
Brice