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

The community will undergo maintenance on October 16th at 10:00 PM PDT and will be unavailable for up to one hour.

WriteCSVFile API withHeader: true changed The order of columns in generated CSV File

AP_10343008
14-Alexandrite

WriteCSVFile API withHeader: true changed The order of columns in generated CSV File

While using the Resources["CSVParserFunctions"].WriteCSVFile API withHeader: true, The order of columns are changed in generated CSV File. How to maintain the same order of columns in CSV File.


Resources["CSVParserFunctions"].WriteCSVFile({
path: "/"+formattedDate+"/"+FolderName+"/"+FileName /* STRING */,
data: ExportData /* INFOTABLE */,
fileRepository: "WCCompareXA_Repository" /* THINGNAME */,
withHeader: true/* BOOLEAN */
});

ACCEPTED SOLUTION

Accepted Solutions
Rocko
17-Peridot
(To:AP_10343008)

The order should be determined by the ordinal of the column which you can set:

table.dataShape.fields["A"].ordinal = 3;
table.dataShape.fields["B"].ordinal = 2;
table.dataShape.fields["C"].ordinal = 1;

Check https://www.ptc.com/en/support/article/CS388066

View solution in original post

1 REPLY 1
Rocko
17-Peridot
(To:AP_10343008)

The order should be determined by the ordinal of the column which you can set:

table.dataShape.fields["A"].ordinal = 3;
table.dataShape.fields["B"].ordinal = 2;
table.dataShape.fields["C"].ordinal = 1;

Check https://www.ptc.com/en/support/article/CS388066

Announcements


Top Tags