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
BedrockMission!

Learn more

View all

Sign in to view all badges

SOLVED

File Update

santhoshsrg
Level 4
Level 4

Hi,

How to write content to a new file or append content to an existing file in Campaign Classic - Workflows?

1 Accepted Solution
pierrec70731455
Correct answer by
Level 5
Level 5

Hi,

if I understand correctly, you have a text file on your adobe campaign server and want to edit it from a workflow.

If so you have a couple of ways to do this :

you can use a script activity, check the the process error option and print vars.output in JS activities afterwards.

to print long logs I like to use this :

var lines = vars.output.split("\n");

for each (var line in lines){

  logInfo("" + line);

}

command script.png

You can also do it all from a JS activity with execCommand (see API doc) :

var result = execCommand('echo "some data for the file" >> fileName');

logInfo(result);

You also have a bunch of methods in JS to access/edit files (cfr API doc) like writeIn.

Kind regards,

Pierre

View solution in original post

2 Replies
pierrec70731455
Correct answer by
Level 5
Level 5

Hi,

if I understand correctly, you have a text file on your adobe campaign server and want to edit it from a workflow.

If so you have a couple of ways to do this :

you can use a script activity, check the the process error option and print vars.output in JS activities afterwards.

to print long logs I like to use this :

var lines = vars.output.split("\n");

for each (var line in lines){

  logInfo("" + line);

}

command script.png

You can also do it all from a JS activity with execCommand (see API doc) :

var result = execCommand('echo "some data for the file" >> fileName');

logInfo(result);

You also have a bunch of methods in JS to access/edit files (cfr API doc) like writeIn.

Kind regards,

Pierre

View solution in original post