Expand my Community achievements bar.

SOLVED

Attach a csv file on a delivery or alert activity that is calculated on the workfow.

Avatar

Level 2

Hello Everyone,

 

Do you know how to attach a CSV file calculated on the workflow to an email or alert activity?

DimitrisChatzos_0-1740570716007.png

I have tried an approach that was suggested here via attachments on the delivery but I have the bellow error.

DimitrisChatzos_1-1740570790002.png

DimitrisChatzos_2-1740570801763.png

I really appreciate any help you can provide.

1 Accepted Solution

Avatar

Correct answer by
Level 3

Hi @DimitrisChatzos,

Use the delivery activity from the Action tab, something like the example below, and place the JavaScript in the Script tab within the delivery activity.

SushantTrimukheD_0-1740574941157.png

 

SushantTrimukheD_1-1740574961980.png



delivery.attachment.add(
  <attachment compressMode="print" filterActive="false" label="my label"
              nameScriptActive="false" type="normal" upload="false">
    <name>{vars.filename}</name>
  </attachment>)

delivery.hasAttachments = true

 Thanks

 

View solution in original post

6 Replies

Avatar

Community Advisor

Hi @DimitrisChatzos ,

In Delivery's script tab, paste the below script and run it.

  delivery.attachment.add(
  <attachment compressMode="print" filterActive="false" label="my label"
              nameScriptActive="false" type="normal" upload="false">
    <name>{vars.filename}</name>
  </attachment>);  
  delivery.hasAttachments = true

Avatar

Correct answer by
Level 3

Hi @DimitrisChatzos,

Use the delivery activity from the Action tab, something like the example below, and place the JavaScript in the Script tab within the delivery activity.

SushantTrimukheD_0-1740574941157.png

 

SushantTrimukheD_1-1740574961980.png



delivery.attachment.add(
  <attachment compressMode="print" filterActive="false" label="my label"
              nameScriptActive="false" type="normal" upload="false">
    <name>{vars.filename}</name>
  </attachment>)

delivery.hasAttachments = true

 Thanks

 

SushantTrimukheD_0-1740575100947.png

 

Hey @SushantTrimukheD and @ParthaSarathy ,

Thanks a lot for your feedback.

I tried the above but I still have the same issue.

DLV-490089 The upload of the attachments to the mid-sourcing server has failed.
 

DimitrisChatzos_0-1740577784634.png

What am I doing wrong?

Thanks,

Avatar

Community Advisor

@DimitrisChatzos , sometimes it does depends on the size of the attachment. So to check it, Just try to export only 4 or 5 rows in it and check whether you're able to send the file as attachment.

Avatar

Level 2

Hello,

The solution worked in the end when I changed the routing from mid-sorce instance to internal email delivery.

 

A couple of things were not so clear in the explanation:

The extraction activity should have this format on the naming convention of the file:  <%= vars.filename %>yourfilename.csv

 

and then the code as described above.

 

delivery.attachment.add(
<attachment compressMode="print" filterActive="false" label="my label"
nameScriptActive="false" type="normal" upload="false">
<name>{vars.filename}</name>
</attachment>)
delivery.hasAttachments = true