File Update | Community
Skip to main content
Level 4
May 2, 2019
Solved

File Update

  • May 2, 2019
  • 2 replies
  • 3074 views

Hi,

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

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by pierrec70731455

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);

}

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

2 replies

pablo_rosero1
Level 9
May 16, 2019
pierrec70731455
pierrec70731455Accepted solution
Level 4
May 16, 2019

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);

}

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