Hi,
I want to export the data in temp work table as csv file & need to attach the file automatically to the email delivery, its fine if i export or import the file to my local machine or from the server. Need some help on this
Regards,
Raaghu
Solved! Go to Solution.
Hi Raaghu,
Please do what I mentioned above:
1. add a Delivery activity (NOT a continuous delivery), based on a Delivery Template (model) in which you select the To field as population coming from workflow.
2. In the wfk delivery activity, click on the 2nd tab (Script tab), then paste this:
delivery.attachment.add(
<attachment compressMode="print" filterActive="false" label="my label"
nameScriptActive="false" type="normal" upload="false">
<name>{instance.vars.filename}</name>
</attachment>)
delivery.hasAttachments = true
That's all
Hi,
Use calculated file attachment:
The filename out of extract transition should be vars.filename, avoid hardcoding the path in the delivery to ease maintenance (use an xtk:option).
Thanks,
-Jon
Hello,
I was trying to use the data extraction activity in the workflow to export the data in the temp work table & to attach it to the email delivery.
1.Need to know how to export the data to server or to the local machine (Anythings fine)
2.How to attach the file automatically to the email delivery after export
3. Or is there any other way to achieve this task.
Views
Replies
Total Likes
Hi Raagu,
In addition of Jon's answer, and because it seems there is not anymore this tip in the documentation regarding attaching files in a delivery, one way of doing it through a workflow is to write this code in the 2nd tab of the delivery activity, from your workflow:
delivery.attachment.add(
<attachment compressMode="print" filterActive="false" label="my label"
nameScriptActive="false" type="normal" upload="false">
<name>{instance.vars.yourvariable}</name>
</attachment>)
delivery.hasAttachments = true
Of course, as Jon mentioned, you can use vars.filename variable.
But take care, in such case, the delivery activity must follow immediately the Extract activity, because other activities can override the variable filename value.
For instance, in some cases, you must attach several files, or compress (zip) the extracted file, or whatever. In such cases, save the vars.filename in JS activity just after the extract in a specific variable (such as instance.vars.yourvariable above) and do some custom JS after each activity changing the vars.filename value.
For example, if you have 2 extract activities, you can attach the 2 files as is:
delivery.attachment.add(
<attachment compressMode="print" filterActive="false" label="my label first file"
nameScriptActive="false" type="normal" upload="false">
<name>{instance.vars.myfirstfilename}</name>
</attachment>)
delivery.attachment.add(
<attachment compressMode="print" filterActive="false" label="my label second file"
nameScriptActive="false" type="normal" upload="false">
<name>{instance.vars.mysecondfilename}</name>
</attachment>)
delivery.hasAttachments = true
Hope this helps.
Regards
J-Serge
Hi Jean,
Can you explain me this "instance.vars.mysecondfilename".
Regards,
Raaghu
Views
Replies
Total Likes
Hi Raaghu,
I didn't want to mislead you.
In simple case, one extract activity, followed by a delivery activity: just use vars.filename.
In complex cases, with several files to attach to the email delivery, or other operation on files (such as compressing and gathering into the zip several files), you can manage it by different variables, storing the factory vars.filename in instance variables to manage the final filename to use for the delivery.
But forget these cases if you don't need them.
Regards
J-Serge
I guess you could use following steps.
1. Your Workflow.
2. File Transfer Activity
3. delivery view
4.Your server file details goes here
Follow these steps
Regards.
Hello,
Thanks for the reply, Here my concern is how to export a file to server so that i can specify the path of the file in the delivery attachment.
Regards,
Raaghu
Views
Replies
Total Likes
Let me elaborate the issue,
In the attachment you can see there are 5 records as DSU & it contains Name & Email of the operator, Now I need to extract those 5 records as CSV file,hence I was using the Extraction activity & please note I dont have any file in my local system to upload, I have to convert the data in temp worktable as CSV & need to upload it to server & then i can attach to delivery.
The problem here is how to export worktable data as csv file to the server & to get the path of it.
Views
Replies
Total Likes
Hi Raaghu,
Please do what I mentioned above:
1. add a Delivery activity (NOT a continuous delivery), based on a Delivery Template (model) in which you select the To field as population coming from workflow.
2. In the wfk delivery activity, click on the 2nd tab (Script tab), then paste this:
delivery.attachment.add(
<attachment compressMode="print" filterActive="false" label="my label"
nameScriptActive="false" type="normal" upload="false">
<name>{instance.vars.filename}</name>
</attachment>)
delivery.hasAttachments = true
That's all
Hi Jean,
Checking this post after 4 years.
I am getting an error doing so.
Are my below steps correct?
Are above 2 steps enough? if yes then i am getting error
OR
Do I have to click on attachment in the delivery and add attachment without uploading fiel to server?
Do I have to click on attachment in the delivery and add attachment and upload sample file on server? – which file to upload and what should be the file name
Thanks in advance
Best
Vedant
Views
Replies
Total Likes
Hi Jean,
I followed the steps you mentioned & I am getting an error in the Delivery
Views
Replies
Total Likes
Hi Jean,
Finally it worked thanks a lot for the help.
But the problem is the file which is attached is in the CSV delimited with semicolon but I need it in column wise, can you help me on this.
Views
Replies
Total Likes
Hi Raaghu,
Fine:)
Regarding the extract file format, it should be another ticket because it is regarding not the delivery attachement.
Anyway, to make it short, even I don't understand what means "column wise", when default csv format is not convenient, you can choose txt format in Extract activity, even though putting a .csv extension, it allows for more choices about separators, etc.
Regards.
J-Serge
Hi i am also getting error in delivery. Can you please tell me how did you resolve that error?
Views
Replies
Total Likes
Hi Pratibha,
Can I know what exactly the error you are mentioning about
Regards,
Raaghu
Views
Replies
Total Likes
Views
Replies
Total Likes
Hi,
i have attached screenshot for error snapshot which am getting in delivery. Please check the attachment and help me to resolve my issues.
Views
Replies
Total Likes
PFA delivery script which i have written in email delivery.
Views
Replies
Total Likes
Hi Pratibha,
Find my attachment bellow I can see some modifications in your script, hence you are getting the error, use the same script as below don't change the "vars.filename" keep it same as the file name is already provided in data extraction activity you will receive the file with same name as mentioned. It works if you keep things same way as i kept below. Hope this helps
Views
Replies
Total Likes
Thank You Raghu .. Its working now.