Pass a variable from pageFunction() via Webhooks JSON
My code:
async function pageFunction(context) {
await context.skipLinks();
const $ = context.jQuery;
const pageTitle = $('title').first().text();
const matches = pageTitle.match(/((\d+))/);
const numberOfTests = 0;
if (matches !== null) {
numberOfTests = parseInt(matches[1]);
}
context.log.info(
${numberOfTests})return {
numberOfTests
}
}
Webhooks integration JSON:
{
"tests": {{resource.numberOfTests}}
}
What am I doing wrong? I tried also:
{
"tests": {{numberOfTests}}
}
but this returns a validation error.
