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
Bedrock Mission!

Learn more

View all

Sign in to view all badges

Join us for our next Adobe Campaign Community Q&A Coffee Break, on Thursday, February 9th @ 9.30 am IST & 9 am PT

How to populate a variable from JavaScript to a column in Data Extraction Activity?


Level 7

Hello Friends,

I have a requirement, where we have to fetch some recipient data and export the same data in a file. Let me give background in detail:

1. Initially we will be fetching some Recipient Data (say 10 records) and retrieving their First Name, Mobile and Email (just example) from Query.

2. Next we will be inserting a record in schema (Transient) created. This schema consists of below fields:

     a. Campaign Identifier (A string value passed in JavaScript as input)

     b. Record Count (A Integer which will store the number of recipients fetched from query (Count)

     c. Primary Key (Auto - generated, whenever a record is inserted)

3. So assume Campaign Identifier is XYZ, Record Count is 10, i will be inserting this two fields in above schema and it somehow looks like below

PRIMARY KEY|Campaign Identifier|Record Count


4. Now i need to export the First Name, Mobile and Email of the Recipients to a file using Data Extraction along with PRIMARY KEY mentioned above.

5. So once file is exported and generated over SFTP, it should somehow look like below:

PRIMARY KEY|First Name|Mobile|Email











6. So I want that Primary Key to be populated for each and every record as shown above.

Can anyone please help me over here. Quick help is appreciated !


Sri Bhargav

2 Replies



Hi Sri Bhargav,

Please use an Enrichment activity before data extraction activity to add a new "Primary Key" column in the temporary schema.

Here, I have stored the primary key of the transient table in an event variable "vars.key". In the Enrichment activity, go to "Edit Additional Data" and add a new output column to store the key.


After this, you will be able to see "Key" in the Data Extraction activity as available columns and add it to the export file.



Nainy Jain