Assuming you are only using numerals for Batch .... then make a collection for the batch numbers ....... Then ... use Code: $$NumItems:(coll name) +1 in the relevant field.