Reports : How to pass parameter captured in page to query activity

Avatar

Avatar

ckumari12

Avatar

ckumari12

ckumari12

22-08-2017

Hi,

I have created one sample report to list all campaign created in this year. I was able to successfully create it.

Now, I want my report to be more flexible.

I want to get results based on the year selected while running the report.

If I select 2016, it should return all campaign created in 2016. For this, I have created a page, created combo box variable, input 3 years 2015,2016,2017.

But I am unable to see this variable in my next activity which is a query activity so that it can dynamically pick that value and return campaign list as per the year selected.

Attached are the images.CampaignRptyearwise.JPGrpt forum.JPG

View Entire Topic

Avatar

Avatar

Jean-Serge_Biro

MVP

Avatar

Jean-Serge_Biro

MVP

Jean-Serge_Biro
MVP

22-08-2017

Hello ckumari,

I don't see any screenshot images attached.

Besides the Adobe Campaign documentation (report section) there are the different standard reports that you should consult (there are a few examples with list boxes and text field for criteria filtering).


But please find some hints below (for Adobe Campaign v6, I don't know at all ACS Adobe Campaign Standard version).


First of all, use the Preview mode with the checkbox Debug value, so you can see easily the context of your report (ctx nodes and values).

If you use a list/combo box with static values (years values hard-coded), you set the storage as a variable in the Page v5 form, so the variable is for instance ctx.vars.yearSelected.

Then, in your Query activity, in the criteria tab section, you set your test as is:

in "Value" column of the expression line:
$([vars/yearSelected])

in "Taken into account if" column:

$([vars/yearSelected]) != ''

If you need to use a Javascript activity with queryDef (for instance if you need a where clause with IN operator, and that the criteria of the reports allows to enter multiple values to search for, in that case queryDef is mandatory), you must test/filter the values by testing undefined or empty values, such as is:

if ( ( ctx.vars.filter_date_debut != undefined ) && ( ctx.vars.filter_date_debut != '' ))

  filterDateDebut = "@DATE_PARTICIPATION >= " + "'" + ctx.vars.filter_date_debut + "'";

And if you need to use a list box value dynamically set from your database, custom or standard tables values, you can set the XPath it as is in the Advanced tab of the Web page form (compatibility v5):

1283911_pastedImage_3.png

Such a report with a dynamic list box values:

1283906_pastedImage_2.png

Regards
J-Serge