Exporting variable values of javascript into a excel file through a workflow

Avatar

Avatar

Ramaswami

Avatar

Ramaswami

Ramaswami

04-06-2020

Hi Team, 

 

Can we export a calculated variable value in javascript to an excel file through a workflow - 

 

Export can be like on a local laptop OR adobe folders inside explorer. 

 

For example : In the below ss we have a javascript and inside javascript we have some variable or some sql query result 

 

Ramaswami_0-1591296590560.png

 

 

 

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar

_Manoj_Kumar

MVP

Avatar

_Manoj_Kumar

MVP

_Manoj_Kumar
MVP

04-06-2020

Hello @Ramaswami ,

Yes, you can export the JS variables in a CSV file.

 

You will have to use the enrichment activity to do so. But you can not use enrichment activity because there is only one javascript activity in your workflow. To make it work you will have to change the workflow to something like this.

manojk62306941_0-1591338355912.png

JS Activity:

 

manojk62306941_1-1591338505305.png

Enrichment activity:

manojk62306941_2-1591338547455.png

 

 

Since you want to automate this. There are 2 ways to get the files with automation.

1) Use data extraction and create the file in Adobe server itself.

2) If you want to receive it on your emails then you can add the delivery activity. (Note to do this you will have to use the file attachment by computation)

 

i have added the additional activities for your reference.

 

 

Answers (1)

Answers (1)

Avatar

Avatar

Jyoti_Y

MVP

Avatar

Jyoti_Y

MVP

Jyoti_Y
MVP

04-06-2020

Hi,

 

Yes you can export local variable value in your export file.

In your JS, define variable as:

vars.output=vars.recCount

 

And then file configuring columns of your export file. Add column using edit the expression and give value as: 

$(vars/@output)

Jyoti_Y_0-1591333134205.png

 

Thanks.