SIL page view report

frithjof falck
Contributor
February 4, 2022

When i try to run the script for a page view report for a single space i get the following error:

You need an array (most probably a struct array) in the first return position of the SIL script.

The space key i'm using is 3PIN. 

The script works fine when im running it for another space, with space key PLAN.

Any ideas?

Script is from this page:

https://confluence.cprime.io/display/CTR/Create+a+page+view+count+report

Page view report

struct table {
string Title;
string Views;
}

string cql = "(type=page and Space=" + argv[0] + ")";
number [] pages = selectPages(cql);

table [] tableData;

for(number p in pages) {
table t;
t.Title = p.title;
t.Views = getPersistentVar(p, "counter");
tableData += t;
}

return tableData;

Page counter

string [] allowedSpaces = "3PIN";

if(arrayElementExists(allowedSpaces, space)) {
persistent number counter = 0;
counter++;
}

0 answers

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events