Skip to main content
Level 2
Aug 12, 2021 7:44 PM UTC
Question

Adobe Campaign Classic - Java Script node LogInfo output to Query as a variable

Hello,

Excuse such a trivial question, but I am new to Adobe Campaign, and I exhausted all possibilities within my reach to accomplish this.
I am trying to do the following: As you can see below, I have a Java Script node that reads the first, last, and email and then stores it in LogInfo. I would like to store the LogInfo data to a variable and parse it to a query node for further analysis/workflow purposes. Please, give me a few suggestions or corrections. Thank you,

 

Below is Java Script code:

Sample workflow screenshot 

 

 

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

4 replies

Manoj_Kumar
Community Advisor
Community Advisor
Aug 16, 2021 8:41 PM UTC

@marioglad  You can use this.
instance.vars.test=rcp.@firstName+" "+rcp.@lastName+" "+rcp.@test;

Translate
Manoj  | https://themartech.pro
Jyoti_Yadav
Level 8
Aug 18, 2021 7:47 AM UTC

Hi @marioglad 

 

Please follow below steps to achieve this:

1) In Javascript activity, save value as:

instance.vars.@fName = rcp.@firstName;

 

2) In query activity, define as:

First name = $(instance/vars/@fName)

 

Thanks,

Jyoti

Translate
Sukrity_Wadhwa
Level 4
Aug 26, 2021 9:55 AM UTC

Hi @marioglad,

 

Were you able to resolve this query with the help of the given solutions or do you still need more help here? Do let us know.

 

Thanks!

Translate
Sukrity Wadhwa
Level 2
Sep 24, 2021 12:23 AM UTC

You may want to consider using some JSON tricks for more complex patterns.  I've made an example with various tricks, below:

 

var obj = {}
logInfo("Converting " + rcp.toXMLString() + " to JSON")
obj.firstName = rcp.@firstName.toString(); // Make sure you use toString()
obj.lastName = rcp.@lastName.toString();

instance.vars.data = JSON.stringify(obj)
logInfo("JSON = " + instance.vars.data)

# .. Later on..

var data = JSON.parse(instance.vars.data)
Translate