Skip to main content
1-Visitor
August 25, 2015
Solved

Is there any documentation for the CSVParser extension? (In particular - the Column Mapping parameter used on some of the services?)

  • August 25, 2015
  • 4 replies
  • 3391 views

I was wondering if someone could either point me in the direction of some documentation for the CSVParser extension (I believe there was some on the old site).

I am trying to get the ReadCSV service to work - it seems to require the 'ColumnMapping' parameter in order to function, which is a STRING input, but nothing I try seems to actually make the service pick up any values (although it does read the header and seems to identify the correct number of rows in the CSV file - the entries all appear to be blank).

Any help would be appreciated !!!

Best answer by mhollenbach

Column mappings are going to be a mapping between fields in your DataShape, defined within the parameters, to the fields in the CSV file. Each mapped column will be separated by a semi-colon. If you want to omit a field do not specify the DataShape field to map it to (see below). The field will still appear in the InfoTable but there will be no data. The columns in the CSV file must be represented by a DataShape field of the same baseType. When mapping a CSV field to a DataShape field, the order you specify the mapping must match the order the fields are, in the CSV file. For example: If your CSV file has 16 fields and you only want the first two,                 columnMappings: "dataShapeField1;;;;;;;;;;;;;;;dataShapeField16"

4 replies

5-Regular Member
August 25, 2015

Column mappings are going to be a mapping between fields in your DataShape, defined within the parameters, to the fields in the CSV file. Each mapped column will be separated by a semi-colon. If you want to omit a field do not specify the DataShape field to map it to (see below). The field will still appear in the InfoTable but there will be no data. The columns in the CSV file must be represented by a DataShape field of the same baseType. When mapping a CSV field to a DataShape field, the order you specify the mapping must match the order the fields are, in the CSV file. For example: If your CSV file has 16 fields and you only want the first two,                 columnMappings: "dataShapeField1;;;;;;;;;;;;;;;dataShapeField16"

sburton-31-VisitorAuthor
1-Visitor
August 25, 2015

Thanks for your help Meghan - I have got it to work now.

I also discovered that the last field on each line of the CSV file also has to have a terminating delimiter otherwise the extension will not recognize the last column of data.

4-Participant
May 25, 2017

Hi Shaun,

Could you please tell me how did you add a terminating delimiter to your csv, do you have an csv example screenshot?

Thanks.