Exporting XML Fields

Avatar

Avatar
Validate 10
Level 2
sagil23995776
Level 2

Likes

17 likes

Total Posts

32 posts

Correct reply

4 solutions
Top badges earned
Validate 10
Validate 1
Boost 5
Boost 3
Boost 10
View profile

Avatar
Validate 10
Level 2
sagil23995776
Level 2

Likes

17 likes

Total Posts

32 posts

Correct reply

4 solutions
Top badges earned
Validate 10
Validate 1
Boost 5
Boost 3
Boost 10
View profile
sagil23995776
Level 2

27-08-2017

Hi,

Is it possible by any way to export an XML field value to a .csv through a workflow?

for example if I wish to export emails subject lines to a file.

Thanks,

Sagi

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar
Validate 1
MVP
Jean-Serge_Biro
MVP

Likes

353 likes

Total Posts

464 posts

Correct reply

153 solutions
Top badges earned
Validate 1
Boost 50
Boost 5
Boost 3
Boost 250
View profile

Avatar
Validate 1
MVP
Jean-Serge_Biro
MVP

Likes

353 likes

Total Posts

464 posts

Correct reply

153 solutions
Top badges earned
Validate 1
Boost 50
Boost 5
Boost 3
Boost 250
View profile
Jean-Serge_Biro
MVP

28-08-2017

Hi There,

In order to be clear, the expected code should work for this 2 examples:

Case 1 Subject field -

<%

if (targetData.target.age > 18)

{

%>

ADULT

<%

}

else

{

%>

MINOR

<%

}

%>

Case 2 Subject field - Hello <% =targetData.firstName %>

Thanks in advance for advice.
J-Serge

Answers (5)

Answers (5)

Avatar

Avatar
Validate 1
MVP
Jean-Serge_Biro
MVP

Likes

353 likes

Total Posts

464 posts

Correct reply

153 solutions
Top badges earned
Validate 1
Boost 50
Boost 5
Boost 3
Boost 250
View profile

Avatar
Validate 1
MVP
Jean-Serge_Biro
MVP

Likes

353 likes

Total Posts

464 posts

Correct reply

153 solutions
Top badges earned
Validate 1
Boost 50
Boost 5
Boost 3
Boost 250
View profile
Jean-Serge_Biro
MVP

28-08-2017

Hi Sagi,

In your JS code as in mine, there is a flaw: if the subject fields contains JS customisation (if then else) or personalisation field, the result is not given correctly, it doesn't take into account the JS code, not interpreted, so the functions return all the labels included.

Actually, the CDATA taken is common to all messages, the delivery itself.

So it should be added 2nd pass JS interpretation, a bit as in Content Management (publication templates), in order that it would be evaluated for the accurate message for 1 contact.

I am looking for the exact syntax to do it either with your solution or mine (standard xpath object).


If someone else could help, it would be appreciated.

Regards
J-Serge

Avatar

Avatar
Validate 1
MVP
Jean-Serge_Biro
MVP

Likes

353 likes

Total Posts

464 posts

Correct reply

153 solutions
Top badges earned
Validate 1
Boost 50
Boost 5
Boost 3
Boost 250
View profile

Avatar
Validate 1
MVP
Jean-Serge_Biro
MVP

Likes

353 likes

Total Posts

464 posts

Correct reply

153 solutions
Top badges earned
Validate 1
Boost 50
Boost 5
Boost 3
Boost 250
View profile
Jean-Serge_Biro
MVP

28-08-2017

Hi Sagi,

While working, your code is a bit risky, in case of Adobe Campaign Product team decides to change the XML memo field.

You should rather use this simple notation in your delivery:

<%= message.delivery.mailParameters.subject %>

Regards
J-Serge

Avatar

Avatar
Validate 10
Level 2
sagil23995776
Level 2

Likes

17 likes

Total Posts

32 posts

Correct reply

4 solutions
Top badges earned
Validate 10
Validate 1
Boost 5
Boost 3
Boost 10
View profile

Avatar
Validate 10
Level 2
sagil23995776
Level 2

Likes

17 likes

Total Posts

32 posts

Correct reply

4 solutions
Top badges earned
Validate 10
Validate 1
Boost 5
Boost 3
Boost 10
View profile
sagil23995776
Level 2

28-08-2017

Hi,

At the end I've managed to get the subject line into a variable by doing this:

instance.vars.subjLine = sqlGetString("select substring(dl.mdata,position('<subject><![CDATA[' in dl.mdata)+18,position(']]></subject>' in dl.mdata)-position('<subject><![CDATA[' in dl.mdata)-18 ) from nmsdelivery dl where sInternalName='DM12345'")

So now I can write it into a file.

Thanks,

Sagi

Avatar

Avatar
Springboard
MVP
Amit_Kumar
MVP

Likes

329 likes

Total Posts

649 posts

Correct reply

231 solutions
Top badges earned
Springboard
Ignite 5
Ignite 3
Ignite 1
Validate 10
View profile

Avatar
Springboard
MVP
Amit_Kumar
MVP

Likes

329 likes

Total Posts

649 posts

Correct reply

231 solutions
Top badges earned
Springboard
Ignite 5
Ignite 3
Ignite 1
Validate 10
View profile
Amit_Kumar
MVP

28-08-2017

Sagi,

As Vipul mentioned, you can not export memo fields in CSV as they are stored in XML format.

You can only export database field like all primitive types, i.e., string, int, boolean, etc.

To export use a file export activity, Read this for instructions.

Exporting data

Regards,

Amit

Avatar

Avatar
Validate 1
Employee
Vapsy
Employee

Likes

370 likes

Total Posts

726 posts

Correct reply

342 solutions
Top badges earned
Validate 1
Boost 50
Boost 5
Boost 3
Boost 250
View profile

Avatar
Validate 1
Employee
Vapsy
Employee

Likes

370 likes

Total Posts

726 posts

Correct reply

342 solutions
Top badges earned
Validate 1
Boost 50
Boost 5
Boost 3
Boost 250
View profile
Vapsy
Employee

28-08-2017

Hi Sagi,

You can export it as an XML file.

Subject is part of memo field of nms:delivery schema and exporting the entire memo field to CSV will not help.

Regards,
Vipul