Get record or page number for import

I have an export that is pulling a batch of 4 records. Each time a record is processed by the import, I'd like to append the record number/index to a memo line in the import mapping.

Record 1 processed by import:
Sales - {{recordNumber}} -> Memo = Sales - 1

Record 2 processed by import:
Sales - {{recordNumber}} -> Memo = Sales - 2

And so on. Anyone have any good suggestion for getting the record number/index of the records as they are brought into an import for processing?

@mattcarter I believe the only script to get pageIndex is with a preSavePage script on your export. Once you know that, you can use Celigo AI to write a quick script for you. Once you have that added, you can setup your mapper on your import.

function preSavePage(options) {
return {
data: options.data.map((record, index) => ({ ...record, pageIndex: options.pageIndex, recordIndex: index })),
errors: options.errors,
abort: false,
newErrorsAndRetryData: []
};
}