Additional Content

How can I do some conditional sctripting in the additional text field, I am trying to create a datamatrix barcode for our NeoPost inserter, most of the detail is available to me via metadat in data or by the sheet number etc, however the only function thats not built in is to see if its the last page in a set, so here is what I need:

${"Grouping: "+if(sheet.sequence.set == set.count.sheets){"B"}else{"A"}}

But this returns an error… any ideas?

Try this:

${'Grouping: '+ (sheet.sequence.set == set.count.sheets ? ‘B’ : ‘A’);}

or

${var text ='Grouping: '+ (sheet.sequence.set == set.count.sheets ? ‘B’ : ‘A’); text;}

Perfect thanks Rod! I forgot about those if params!

I was hoping the Post Pagination script would allow me to do what I wanted in designer, but it doesnt seem the case as it doesnt calculate the Page pagination accross records from what I can see, here is what I have so far but it isnt working as the page numbers are incorrect:

var page = results;
var barcode = "";
var sequenceArray = ["","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"];
var formSeq = 0;

function divide (number){
	if(number > 26){
		var newnumber = number - 26;
		return divide(newnumber);
	}else{
		return number ;
	}
}

results.each(function(index) {
	formSeq++;
	// #1 Grouping
	if(this.info().sheetNo == this.info().sheetCount)
	{
		barcode += "B";
	} else{
		barcode +="A";
	}
	
	// #2-3 Selective Feed
	var station1 = [["A"],["B","",["D","","",["H","","","","P"],"L"],["F","","","","N"],"J"],["C","","",["G","","","","O"],"K"],["E","","","","M"],["I"]];
	var station2 = ["A","","","","","B"];
	
	for(insert in inserts)
	{
		if (insert == countryCode){
			barcode += station1[inserts[insert][0]["feedstation"]][0];
		}
	}
	barcode += station2[5];
	
	// #4 Form Sequence within Job (A>>>Z) - Every Page in job sheetNo + kseq -1
//	barcode += sequenceArray[divide((this.info().sheetNo + json_data.kseq) - 1)];
	barcode += ":"+index+":";
	
	// #5 Form Sequence within Group (A>>>Z) - Sheets No in Record
	barcode += sequenceArray[divide(this.info().sheetNo)];
	
	// #6 Group Sequence (A>>>Z) - Kseq
	barcode += sequenceArray[divide((json_data.kseq))];
	
	// #7 Divert/Jog (A=No Divert or Jog, K=Ink Mark / VS Jog or U= InkMark and No Seal)
	barcode += "A";
	
	// #8-17 JobID (10 Digits)
	var jobID = "0000000000"+json_data.kbatch;
	barcode += jobID.substr(jobID.length-10, 10);
	
	// #18-27 Mail Piece ID (10 Digits)
	var id = "0000000000"+record.fields.id;
	barcode += id.substr(id.length-10, 10);
	
});
results.html(barcode);

Post Pagination only applies to print sections and are ran per record. It does not provide information across records and it does not replace the features in the Output Preset Wizard which retrieve page and sheet information across records of the same job.

I think your best bet is to use the Add Additional Content option in the Output Preset Wizard if you need the page and sheet infomation across the records of the same job.