Print record X of recordcount

I can’t find a way to print the current record number and the total record count in a Designer template. Is this possible in the Designer or should I do something in the Datamapper?

Hello hierdene,

You would have access to the current record through the record.index variable in DataMapper, which you can easily extract in a JavaScript mode on the field. However, the total number of records is not available due to the ability of DataMapper to automatically split the data mapping task between multiple engines under certain circumstances, which would skew the number.

Regards,
~Evie

Hi Evie,

Thanks, but I’m new to connect and I’m not sure how to use JavaScript. I will search how to this.

Regards,
Edwin

Hi Evie,

Total recordcount I got by an action before the extraction in the datamapper by:

var reader = openTextReader(data.filename);
recordCount = 0;
while((line = reader.readLine())!= null){
recordCount = recordCount + 1;
}
// Because of header line, substract one of recordCount
recordCount = recordCount -1;

I think this is done only once, because it looks like it is fast and I have no loops?

Regards,

Edwin