Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn More

View all

Sign in to view all badges

Campaign Delivery- Attachment

Avatar

Avatar
Validate 1
Level 2
Raaghuik
Level 2

Likes

8 likes

Total Posts

21 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Boost 5
Boost 3
Boost 1
View profile

Avatar
Validate 1
Level 2
Raaghuik
Level 2

Likes

8 likes

Total Posts

21 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Boost 5
Boost 3
Boost 1
View profile
Raaghuik
Level 2

05-03-2019

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

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar
Validate 1
MVP
Jean-Serge_Biro
MVP

Likes

353 likes

Total Posts

464 posts

Correct Reply

153 solutions
Top badges earned
Validate 1
Boost 50
Boost 5
Boost 3
Boost 250
View profile

Avatar
Validate 1
MVP
Jean-Serge_Biro
MVP

Likes

353 likes

Total Posts

464 posts

Correct Reply

153 solutions
Top badges earned
Validate 1
Boost 50
Boost 5
Boost 3
Boost 250
View profile
Jean-Serge_Biro
MVP

06-03-2019

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

Answers (18)

Answers (18)

Avatar

Avatar
Validate 1
MVP
Jean-Serge_Biro
MVP

Likes

353 likes

Total Posts

464 posts

Correct Reply

153 solutions
Top badges earned
Validate 1
Boost 50
Boost 5
Boost 3
Boost 250
View profile

Avatar
Validate 1
MVP
Jean-Serge_Biro
MVP

Likes

353 likes

Total Posts

464 posts

Correct Reply

153 solutions
Top badges earned
Validate 1
Boost 50
Boost 5
Boost 3
Boost 250
View profile
Jean-Serge_Biro
MVP

07-03-2019

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

Avatar

Avatar
Validate 1
Level 3
asariaaara
Level 3

Likes

18 likes

Total Posts

48 posts

Correct Reply

2 solutions
Top badges earned
Validate 1
Boost 5
Boost 3
Boost 10
Boost 1
View profile

Avatar
Validate 1
Level 3
asariaaara
Level 3

Likes

18 likes

Total Posts

48 posts

Correct Reply

2 solutions
Top badges earned
Validate 1
Boost 5
Boost 3
Boost 10
Boost 1
View profile
asariaaara
Level 3

06-03-2019

I guess you could use following steps.

1. Your Workflow.

1706135_pastedImage_0.png

2. File Transfer Activity

1706136_pastedImage_1.png

3. delivery view

1706137_pastedImage_2.png

4.Your server file details goes here

1706141_pastedImage_3.png

Follow these steps

Regards.

Avatar

Avatar
Validate 1
MVP
Jean-Serge_Biro
MVP

Likes

353 likes

Total Posts

464 posts

Correct Reply

153 solutions
Top badges earned
Validate 1
Boost 50
Boost 5
Boost 3
Boost 250
View profile

Avatar
Validate 1
MVP
Jean-Serge_Biro
MVP

Likes

353 likes

Total Posts

464 posts

Correct Reply

153 solutions
Top badges earned
Validate 1
Boost 50
Boost 5
Boost 3
Boost 250
View profile
Jean-Serge_Biro
MVP

06-03-2019

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

Avatar

Avatar
Validate 1
MVP
Jean-Serge_Biro
MVP

Likes

353 likes

Total Posts

464 posts

Correct Reply

153 solutions
Top badges earned
Validate 1
Boost 50
Boost 5
Boost 3
Boost 250
View profile

Avatar
Validate 1
MVP
Jean-Serge_Biro
MVP

Likes

353 likes

Total Posts

464 posts

Correct Reply

153 solutions
Top badges earned
Validate 1
Boost 50
Boost 5
Boost 3
Boost 250
View profile
Jean-Serge_Biro
MVP

06-03-2019

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

Avatar

Avatar
Establish
MVP
wodnicki
MVP

Likes

976 likes

Total Posts

1,096 posts

Correct Reply

514 solutions
Top badges earned
Establish
Affirm 500
Contributor
Shape 1
Give Back 100
View profile

Avatar
Establish
MVP
wodnicki
MVP

Likes

976 likes

Total Posts

1,096 posts

Correct Reply

514 solutions
Top badges earned
Establish
Affirm 500
Contributor
Shape 1
Give Back 100
View profile
wodnicki
MVP

05-03-2019

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

Avatar

Avatar
Level 1
pratibham904108
Level 1

Likes

0 likes

Total Posts

5 posts

Correct Reply

0 solutions
View profile

Avatar
Level 1
pratibham904108
Level 1

Likes

0 likes

Total Posts

5 posts

Correct Reply

0 solutions
View profile
pratibham904108
Level 1

19-08-2019

Thank You Raghu .. Its working now.

Avatar

Avatar
Validate 1
Level 2
Raaghuik
Level 2

Likes

8 likes

Total Posts

21 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Boost 5
Boost 3
Boost 1
View profile

Avatar
Validate 1
Level 2
Raaghuik
Level 2

Likes

8 likes

Total Posts

21 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Boost 5
Boost 3
Boost 1
View profile
Raaghuik
Level 2

19-08-2019

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

1.JPG

2.JPG

Avatar

Avatar
Level 1
pratibham904108
Level 1

Likes

0 likes

Total Posts

5 posts

Correct Reply

0 solutions
View profile

Avatar
Level 1
pratibham904108
Level 1

Likes

0 likes

Total Posts

5 posts

Correct Reply

0 solutions
View profile
pratibham904108
Level 1

18-08-2019

PFA delivery script  which i have written in email delivery.deliveryscript_updated.PNG

Avatar

Avatar
Level 1
pratibham904108
Level 1

Likes

0 likes

Total Posts

5 posts

Correct Reply

0 solutions
View profile

Avatar
Level 1
pratibham904108
Level 1

Likes

0 likes

Total Posts

5 posts

Correct Reply

0 solutions
View profile
pratibham904108
Level 1

18-08-2019

Hi,

i have attached screenshot for error snapshot which am getting in delivery. Please check the attachment and help me to resolve my issues.

delivery error.PNGdeliveryscript.PNGexportworkflow.PNG

Avatar

Avatar
Validate 1
Level 2
Raaghuik
Level 2

Likes

8 likes

Total Posts

21 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Boost 5
Boost 3
Boost 1
View profile

Avatar
Validate 1
Level 2
Raaghuik
Level 2

Likes

8 likes

Total Posts

21 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Boost 5
Boost 3
Boost 1
View profile
Raaghuik
Level 2

16-08-2019

Hi pratibham90410856,

Can I know what exactly the error you are mentioning about

Regards,

Raaghu

Avatar

Avatar
Validate 1
Level 2
Raaghuik
Level 2

Likes

8 likes

Total Posts

21 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Boost 5
Boost 3
Boost 1
View profile

Avatar
Validate 1
Level 2
Raaghuik
Level 2

Likes

8 likes

Total Posts

21 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Boost 5
Boost 3
Boost 1
View profile
Raaghuik
Level 2

16-08-2019

Hi Pratibha,

Can I know what exactly the error you are mentioning about

Regards,

Raaghu

Avatar

Avatar
Level 1
pratibham904108
Level 1

Likes

0 likes

Total Posts

5 posts

Correct Reply

0 solutions
View profile

Avatar
Level 1
pratibham904108
Level 1

Likes

0 likes

Total Posts

5 posts

Correct Reply

0 solutions
View profile
pratibham904108
Level 1

16-08-2019

Hi i am also getting error in delivery. Can you please tell me how did you resolve that error?

Avatar

Avatar
Validate 1
Level 2
Raaghuik
Level 2

Likes

8 likes

Total Posts

21 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Boost 5
Boost 3
Boost 1
View profile

Avatar
Validate 1
Level 2
Raaghuik
Level 2

Likes

8 likes

Total Posts

21 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Boost 5
Boost 3
Boost 1
View profile
Raaghuik
Level 2

07-03-2019

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.

Avatar

Avatar
Validate 1
Level 2
Raaghuik
Level 2

Likes

8 likes

Total Posts

21 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Boost 5
Boost 3
Boost 1
View profile

Avatar
Validate 1
Level 2
Raaghuik
Level 2

Likes

8 likes

Total Posts

21 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Boost 5
Boost 3
Boost 1
View profile
Raaghuik
Level 2

07-03-2019

Hi Jean,

I followed the steps you mentioned & I am getting an error in the Delivery

g.JPG

h.JPG

i.JPG

J.JPG

k.JPG

Avatar

Avatar
Validate 1
Level 2
Raaghuik
Level 2

Likes

8 likes

Total Posts

21 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Boost 5
Boost 3
Boost 1
View profile

Avatar
Validate 1
Level 2
Raaghuik
Level 2

Likes

8 likes

Total Posts

21 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Boost 5
Boost 3
Boost 1
View profile
Raaghuik
Level 2

06-03-2019

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.

f.JPG

Avatar

Avatar
Validate 1
Level 2
Raaghuik
Level 2

Likes

8 likes

Total Posts

21 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Boost 5
Boost 3
Boost 1
View profile

Avatar
Validate 1
Level 2
Raaghuik
Level 2

Likes

8 likes

Total Posts

21 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Boost 5
Boost 3
Boost 1
View profile
Raaghuik
Level 2

06-03-2019

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

Avatar

Avatar
Validate 1
Level 2
Raaghuik
Level 2

Likes

8 likes

Total Posts

21 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Boost 5
Boost 3
Boost 1
View profile

Avatar
Validate 1
Level 2
Raaghuik
Level 2

Likes

8 likes

Total Posts

21 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Boost 5
Boost 3
Boost 1
View profile
Raaghuik
Level 2

06-03-2019

Hi Jean,

Can you explain me this "instance.vars.mysecondfilename".

Regards,

Raaghu

Avatar

Avatar
Validate 1
Level 2
Raaghuik
Level 2

Likes

8 likes

Total Posts

21 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Boost 5
Boost 3
Boost 1
View profile

Avatar
Validate 1
Level 2
Raaghuik
Level 2

Likes

8 likes

Total Posts

21 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Boost 5
Boost 3
Boost 1
View profile
Raaghuik
Level 2

05-03-2019

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.

e.JPG