Skip to main content
SurabattulaSr
Level 6
4월 27, 2019 2:06 오후 UTC
해결됨

How to write Delivery and Exclusion Logs to the same file?

Hello Folks,

I am writing Delivery Logs to a file and exporting to a server location using Data Extraction activity.

Order of workflow activities: Scheduler -> Query -> Data Extraction -> Alert -> End

File Name is: Email_Stats_2019-04-27 004523.csv

1. I want to include Exclusion Logs in the same file, but since both are different entities can someone please help me on how can i achieve this?.

2. Also, how do we write data to a same file using Extraction Activity without overriding already existing data? I had ran workflow and it exported a file with some data, next time if i ran it should add new data to the existing file, instead of overriding old data.

Quick help is appreciated!

Regards,

Sri Bhargav

이 주제는 답변이 닫혔습니다.
Jonathon_wodnicki
Community Advisor
4월 29, 2019 10:20 오후 UTC

Hi,

Update your workflow, adding a fork, 2nd query and union:

Scheduler -> Fork -> Query, Query -> Union -> Data Extraction -> Alert -> End

Union just set to all shared columns, should work.

Thanks,

-Jon

7 답변

SurabattulaSr
SurabattulaSr작성자
Level 6
4월 29, 2019 4:56 오전 UTC

Folks, Any pointers please?

Regards,

Sri Bhargav

번역
Jonathon_wodnicki
Community Advisor
Community Advisor
4월 29, 2019 10:20 오후 UTC

Hi,

Update your workflow, adding a fork, 2nd query and union:

Scheduler -> Fork -> Query, Query -> Union -> Data Extraction -> Alert -> End

Union just set to all shared columns, should work.

Thanks,

-Jon

번역
Jonathon_wodnicki
Community Advisor
Community Advisor
4월 29, 2019 10:38 오후 UTC

For append instead of overwrite: write to a different file, then use a js activity to append one to the other- command in linux would be execCommand('cat path_to_new_file >> path_to_old_file')

번역
SurabattulaSr
SurabattulaSr작성자
Level 6
4월 30, 2019 9:25 오전 UTC

Thank you wodnicki! Will try in this way

Regards,

Sri Bhargav

번역
SurabattulaSr
SurabattulaSr작성자
Level 6
4월 30, 2019 9:28 오전 UTC

Thanks wodnicki ! if first approach works. Then i may not need this, but surely will try this way out too

Regards,

Sri Bhargav

번역
SurabattulaSr
SurabattulaSr작성자
Level 6
5월 1, 2019 6:05 오전 UTC

Hi Wodnicki,

I am able to export both in a single file using Data Extraction activity and flow what you mentioned.

I am trying using JS too. But facing some challenges. Can i have some reference please

Regards,

Sri Bhargav

번역
Jonathon_wodnicki
Community Advisor
Community Advisor
5월 1, 2019 2:00 오후 UTC

Hi,

That shell call's for linux; if you're under Windows without wsl, use 'type' instead of cat:

execCommand('type path_to_new_file >> path_to_old_file')

The paths are what was set in the extract activity, for path_to_new_file you can use vars.filename.

Thanks,

-Jon

번역