Using Actions in Switch with the Quick Check, how to?

I have a Switch flow where we want to find how many pages there is in a PDF. I tried to use the Actions in the flow and it can use a Quick Check. To do so it asks for a .cfg file. It has a sample.cfg but where is it.

How should the .cfg look for just do a app.doc.numPages?

Is this enough?
let numbOfPages = app.doc.numPages;

app.vars.numberOfPages = numbOfPages;

Would be nice with some documentation covering this.

Thanks

Hi Jan,

the Action lists all .cfg files from var/Reports/QuickCheck by default. And the syntax can be found here:

But the best - also to testing beforehand - would be using Desktop and the ProcessPlan step “Quick Check” where you also have a filter on the Info button “Insert Quick Check objects …”. But the content of the .cfg files for --quickcheck (or Switch action) is just the text from the “quickcheck_config” array or here an overview:

For your concrete question regarding number of pages:

$.direct: false
$.aggregated: false
$.aggregated.pages.length: true

Best regards,
René

Thanks for the explanation.

Is there a way to also configure the content of the dataset you can send out.

This will be used in a big Switch flow and I need the JSON structure to be the same as it is from pdfToolbox processplans. In them I also output app.doc.numPages. as a named app.vars.numberOfPages

I am not fully sure to understand the question. But the dataset cannot be changed, it is the JSON output from the --quickcheck … But it sounds more likely you can/should use QuickCheck directly in a Process Plan which would be also easier to fill the app.vars object as your needs. Or transform the QuickCheck dataset JSON in Switch to something which can be used for --setvariable later.

Yes I did it with a process plan and a Quick check.
This is the code I used:
let numbOfPages = app.doc.numPages;

app.vars.numberOfPages = numbOfPages;

Then I get then “numbOfPages”: 1 in the vardump

Just wanted to see how the Action Quick check could be configured.

Thanks