Is it possible to add a field in the datamapper with a sequence number automatically generated for each record, beginning from 000001 to infinity?
Thank you,
C
Is it possible to add a field in the datamapper with a sequence number automatically generated for each record, beginning from 000001 to infinity?
Thank you,
C
Not currently, because all records are independent from one another and a sequence number establishes an ordering dependency. What you can do, though, is generate that sequence number after the fact: call the data mapping operation from Workflow, making sure you set the option to retrieve the records and store them in the metadata. Then, in a branch, add a Metadata Sequencer task that processes all Metadata Documents, followed by a Metadata Field Management task that adds a sequence number to the _vger_fld_ExtraData field (you can use the %i system variable as your sequence if you want to keep things simple). Make sure the branch is set to not back up the job file because you want the metadata that was modified in the branch to be available to you once you’re back on the trunk of the process.
Then on the Trunk, use the Update Data Records task to make sure these new values are stored back into the Connect Database.
Your template will then be able to use the value in the ExtraData field as a squence number.
For small jobs that don’'t get resorted via a job preset or anything in Workflow I add a javascript field to the data mapper and add…
record.index;
That will add a sequence number starting from 1 onwards.