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

Export Survey Results Embedded in Email Not Attachment


Level 1


I am looking to export data from our surveys direct to our contact centre to action any issues raised. I have previously been doing this using a calculated attachment, but our contact centre are having issues with these.

How can I calculate the email content to include the results from the survey, rather than attaching a spreadsheet?


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

1 Reply


Level 3

Hi @daniellee605809 ,


You could use the Query definition in the java script to directly fetch the survey data from the response to recipient forms or from the temporary table that is generated right after the query activity that fetches the data from response to recipient forms in the workflow.


Step 1 : Use a Java Script activity with QueryDef to fecth survey data

             Data oriented APIs | Adobe Campaign

Step 2 : in the same Java Script Use for each loop to run through the query      result 

Step 3 : in the same Java Script with the for each loop use variable(vars.html / instance.vars.html) along with Add AND assignment operator (+=) to generate the html code by appending the survey field values.


var condition="[@webAppLog-id] > 0";
var query = xtk.queryDef.create(
<queryDef schema="temp:readSurvey" operation="select">
<node expr="First_Name"/>

<node expr="Last_Name"/>
<node expr="Rating"/>
<node expr="@email"/>
<condition expr={condition} />



var res = query.ExecuteQuery();

for each (var item in res.readSurvey) {
vars.html +="<tr><td>"+item.First_Name+"</td><td>"+item.Last_Name+"</td><td>"+item.Rating+"</td><td>""</td><td>"




Step 4 : use the variable in the delivery activity by including it in the delivery variables.

Step 5 :  include the delivery variable in the HTML email body.

Step 6 : Execute and test.



Shine v.v