Team,
Is there any way to send a report via workflow ?
I see there is a topic about this: Sending a report to a list
I am trying different way via normal delivery and few of recipients but trying to incorporate the java script from this topic within workflow but its giving an error.
----
js JST-310000 Error while compiling script 'SWKF9679/js' line 8: missing = in XML attribute (line='_context_"global"/> ' token='"global"/> ').
----
Is there any way to incorporate out of the box report within delivery as an (calculated) attachment?
Thanks!
Solved! Go to Solution.
Hi Alistairk,
Everything can be done, but it is often tricky... fortunately there is the debug view to see the context elements/attributes (and so parameters/values available asURL GET parameters).
For instance, if you need a report specific to a delivery, but without having a Adobe Campaign operator (anonymous mode), you can achieve the query activity in the report with a deliveryId parameter (URL) and deal with it as is:
http://yourdomain/report/RPT_hoturl_anonymous_access?_selection=770392130
Regards
JS
Views
Replies
Total Likes
Hi Priyal,
Please may you paste your Javascript code equivalent of that one given in the documentation:
var _ctx = <ctx _context="global" _reportContext={reportName} />xtk.report.export(reportName,_ctx,exportFormat,path,isAdHoc)
You should check for syntax, it seems you don't have put a = but a _ if I understand the error:
_context_"global
Regards
J-Serge
Views
Replies
Total Likes
Thanks Jean!
Now I am getting another error for export.
here is the javacode I am using:, not sure if the export error is because campaign cannot write to local c:\\?
Should it be a server url (adobe cloud may be?)
Thanks!
Views
Replies
Total Likes
Yes, the documentation example was given with a Windows server in mind, so the syntax such as D:\Temp folder (if you don't give a full path, it is written in the workflow process folder).
On linux, you would have a folder such as /tmp/blablabla/ (no C:\ drive letter); or let it in the wkf subfolder, as you prefer.
For my part, I prefer defining specific folders outside the Adobe Campaign path. Do what is convenient for you
Regards
JS
Actually, I am trying to include the out of box report from Adobe.
and I am using windows platform.
Any suggestions?
Views
Replies
Total Likes
Hi Priyal,
I don't understand, indeed. The path /usr/local/neolane/v6 is typical of a Linux installation.
Please check with your admin.
Regards
JS
Views
Replies
Total Likes
Hi Priyal,
As Jean-Serge mentioned, given the error, it seems your Campaign application server is installed on Linux. So you'd want to use paths that can be accessed from the server. Please check that with your admin or with Adobe's support team if your instance is hosted by Adobe.
Florent
Views
Replies
Total Likes
Hi Priyal,
Were you able to get this to work?
Let us know,
Florent
Views
Replies
Total Likes
Hi florentlb,
Sorry for delayed response, yes now the script is working but for XLS with Adobe's resource help, we were able to fix the java script and run and email a report automatically.
Initially I thought this process would associate report only related to particular campaign/workflow its built into, but it captures the report for all the emails that went out from Adobe until that time. for example if I were to specify "deliveryfeedback" report, is there any way to specify the campaign name or delivery name based off which report will be calculated ?
If there is some parameter that can be passed in the java script to mention a campaign/delivery internal name or label to to restrict this automated report to a campaign/delivery?
Thanks in advance!
Views
Replies
Total Likes
Hi florentlb,
Sorry for delayed response, yes now the script is working but for XLS with Adobe's resource help, we were able to fix the java script and run and email a report automatically.
Initially I thought this process would associate report only related to particular campaign/workflow its built into, but it captures the report for all the emails that went out from Adobe until that time. for example if I were to specify "deliveryfeedback" report, is there any way to specify the campaign name or delivery name based off which report will be calculated ?
If there is some parameter that can be passed in the java script to mention a campaign/delivery internal name or label to to restrict this automated report to a campaign/delivery?
Thanks in advance!
Views
Replies
Total Likes
Hi Priyal,
Not sure if there's a parameter I don't know much about v6 reports. I'd have assumed that it was be specified in the "context".
Florent
Views
Replies
Total Likes
Hi Priyal,
The behavior is normal, because you defined the _context parameter with "global" value.
To be able to restrict/select to a or some deliveries, you must firstly allow your report properties not be only global but contextual:
Then, the report workflow must deal accordingly to you delivery/several deliveries/global context.
See for instance the factory report statisticsPerDelivery (with Test activity) in case of both global or selected deliveries behavior).
If only one or several deliveries are allowed (not global case) then refer for example to the factory deliverySending report.
In all cases the first Query activity should have the Filter with context checkbox selected:
Of course, in some scenarios (for example doing code in Javascript activity), you can manage the defined records to select programmatically.
By the way, if you could mark our replies as helpful and mark it as correct when completed and satisfactory, it would be appreciated so we can see in the forum list that the ticket is not to be dealt with.
Many thanks in advance.
Regards
J-Serge
Hi J-Serge,
Thanks for this - it's very helpful. What would be the other ctx variables you would use for these reports? Global is fairly obvious, what parameters would you use to pull a campaign level report or a delivery level report? Would the correct parameter for these be an exact copy of the selection type (Single-selection etc...) or something different.
This is of course assuming that your report is set up to allow this level of reporting.
Thanks!
Views
Replies
Total Likes
Hi Alistairk,
Everything can be done, but it is often tricky... fortunately there is the debug view to see the context elements/attributes (and so parameters/values available asURL GET parameters).
For instance, if you need a report specific to a delivery, but without having a Adobe Campaign operator (anonymous mode), you can achieve the query activity in the report with a deliveryId parameter (URL) and deal with it as is:
http://yourdomain/report/RPT_hoturl_anonymous_access?_selection=770392130
Regards
JS
Views
Replies
Total Likes
Thanks Jean-Serge !
Super helpful, I am going to give it a try in next couple days and update here.
I am planning to duplicate one of deliveryFeedback and use single/multiselect and will try to call it from the workflow.
Views
Replies
Total Likes
I think I get the point that, we could have report single/multiselect , instead of global it looks for "selection" context type, which I am not sure if possible from script, because the way I am trying to achieve is, from workflow standpoint, where the actual workflow is part of a campaign....so hypothetically the need to read current campaign (name/internal name) and/or delivery internalName, with the help of java script or variables. Eventually achieving those parameters passed to report, that should restrict/ pull stats for that particular campaign.
There are reports they look like they read these directly based on delivery selection(s), trying to evaluate those java scripts.
Please do share your opinions if my hypothesis is wrong or your suggestions.
Appreciate your help!!
Views
Replies
Total Likes
Hi Priyal,
I am not sure if you can solve your problem with J-Serge's response, but if you are still looking for the same, please refer to below list of the variables you can use in context in your script fro standard reports.
Name of a variable | Description | Example of a value |
_reportContext | Internal name of the report | opensByUserAgent |
_context | Report context | selection |
_hasFilter | Advanced filter | FALSE |
_selectionCount | how many you have selected | 1 |
_selection | id of selected record | 56855633 |
_schema | Target schema of report | nms:delivery |
_folderModel | folder template for target scema | nmsDelivery |
_folderLinkId | id of the selected folder | @folder-id |
_folderLink | link name of folder | folder |
Regards,
Amit
Thanks Amit!
I will try few of these to restrict the script of pass only few deliveries/folder.
Is there any other way you are ware of automating reports?
I am trying multiple ways if possibility to automate for campaigns.
Thanks!
Views
Replies
Total Likes
Everyone,
This is working now, I will post more details once I validate few more things.
Thanks everyone for your help!
PB
Views
Replies
Total Likes
Hi Priyal,
Can you please share here the script that worked out for you with the XLS option. Running OK for one of our customers but the workflow not stopping. I think there is an issue with the javascript.
Views
Replies
Total Likes
Hi asjohnso,
Yes your workflow could take very long time to stop probably days if your customer has launched millions of emails from Campaign.
Since you are pulling as global context, its trying to capture all the emails that ever sent out from all campaigns/deliveries.
Here is the script you could use to limit via selection and pass delivery pk.
~~~~~~~~~~~~~~~~~~~
var reportName = "deliveryFeedback";
var path = '/usr/local/neolane/nl6/var/' + getOption('NmsTracking_Instance') + '/export/test3'+formatDate(new Date(), "%2D%2M%2Y")+'.xls';
logInfo(path);
var exportFormat = "XLS"; // export format
isAdHoc = false; // is ad hoc?
var _ctx = <ctx _context="selection" _reportContext={reportName} _selection= "24817905" />; //context selection and delivery Pk
xtk.report.export(reportName,_ctx,exportFormat,path,isAdHoc); //submit request
~~~~~~~~~~~~~~~~~~~
Hope this helps!
Thanks!
Views
Replies
Total Likes
Views
Likes
Replies
Views
Likes
Replies