Expand my Community achievements bar.

SOLVED

How to add 2 attachment coming from data extraction activity in Recurring delivery activity

Avatar

Level 4

Hi all,

 

@ParthaSarathy 

need one help based on your old post

https://experienceleaguecommunities.adobe.com/t5/adobe-campaign-classic-questions/how-to-fetch-total...

I need to add 2 attachment coming from data extraction activity in Recurring delivery activit

  1. DishaSharma_1-1725594972432.png

     

  2. Data extraction activity1:filetest.csv and Data extraction activity2:filetest.csv

  3. JS activity:

  4. instance.vars.filetest = vars.filename;
    instance.vars.filetest = vars.filename1;

cOde in open tab of recurring delivery:

 

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

Reference

however with below workflow I am able to get 1 attachment in delivery as I am sending only 1 file here

DishaSharma_4-1725595567600.png

 

 

can un please help me here how can i send 2 attachments via one delivery

how can i modify the code and where

 

 

Topics

Topics help categorize Community content and increase your ability to discover relevant content.

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

Hi @DishaSharma ,

Store both file name in 2 different variables, and use the below script in delivery

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

View solution in original post

4 Replies

Avatar

Correct answer by
Community Advisor

Hi @DishaSharma ,

Store both file name in 2 different variables, and use the below script in delivery

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

Avatar

Level 4

@ParthaSarathy 

 

Hi, Thanks for your reply..

but I have tried the script which u mentioned in delivery activity

but with this script my delivery is getting failed, it is NOT Getting to finished state

It seems may be something wrong m doing, can u please tell me what should I put in Javascript activity, may be this is the issue

below code i am using in Javascript activity


instance.vars.file_1=vars.filename1;
instance.vars.file_2=vars.filename2;

 

Please let me know if this fine or I need to make some changes

 

 

Avatar

Community Advisor

@DishaSharma , Use the below script in its respective JS activity,

ParthaSarathy_0-1725607474973.png

 

//JS 1 activity:
instance.vars.file_1 = vars.filename;

//JS 2 activity:
instance.vars.file_2 = vars.filename;