I’m currently using a conditional mark through output preset to be applied every time page.nr = doument.count.pages
I need to change that to be based on a document field change.
for example the condition will be OFF as long as the value of this data is the same, and be ON on a value change.
How can I achieve that?
Well, you can compare to a field value by using Metadata. You’d have to first set up the metadata through a Job Creation Preset, checking the Include Metadata option. You’d then include the particular field.
Next, in the OMR condition, you can access them like so:
document.metadata.Country == ‘CA’;
Where my metadata name was Country and I’m comparing if it’s Canada or not.
However, in the conditional mark itself, you’d have no way of comparing the values (current to previous). It can only access the metadata for the current record, not the previous. So you couldn’t say that the value changed in respect to the previous record.
What you might consider instead, is using Job Creation Presets to group your data by the field you’re looking to compare.
So, to keep with my Country code example, I might consider doing a Document Set Grouping on Country. This way, I know that all CA is one document set, all US is another, and so on… Treated like this, I don’t need to compare values to see if it’s changed. I know automatically that it’s changed if I’ve reached the end of my current document set.
I can therefore use set.count.pages to determine the total number of pages in my set, and sheet.sequence.set to know where I’m at currently in the set.
You’d then use these two to do exactly the same sort of condition as you were doing previously with page.nr. Only instead of looking at the pages and page count within a document, you’re now looking at the pages and page count within a set of documents that have been grouped on a common value.
You sir are a genius!!
Can’t thank you enough. I wasn’t actually familiar with these variable objects e.g. ( set.count.pages ,…)
Appreciate your help.
One point of clarification:
Sheet will return the number based on physical output sheets (ie, duplex 4 pages, 2 sheets)
Page then returns based off of the number of pages, front and back.
You can see more about these variables here: PlanetPress Connect 1.7.1 User Guide?
Though currently the documentation does not mention Sheet and Sheets, you can use them in place of Page and Pages in any of those variables.