Expand my Community achievements bar.

Adobe Campaign User Groups are live now. Join our Adobe Campaign User Groups and connect with your local leaders!
SOLVED

How to read ctx inner node values inside an RT Email Template?

Avatar

Level 2

Hi All,

 

Example of my SOAP Push Event payload:

<ctx>
	<information>
		<paragraph>Lorem Ipsum One</paragraph>
		<status>red</status>
	</information>
	<information>
		<paragraph>Lorem Ipsum Two</paragraph>
		<status>yellow</status>
	</information>
	.
	.
	.
	N
</ctx>

Inside the RT Email Template, I want to fetch and validate value for node status for each rtEvent.ctx.information and display the value within node paragraph.

For example if status = red, then display "Alert" and so on.

 

Expected Output:

Lorem Ipsum One - red - Alert

Lorem Ipsum Two - yellow - Warning

and so on

Topics

Topics help categorize Community content and increase your ability to discover relevant content.

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

Hi @Anushka_RK,

 

You can do it like this:

 

 

var infos = rtEvent.ctx.information;
for each (var info in infos){
if(info.status.toString() == "red"){
//alert
}
if(info.status.toString() == "yellow"){
//warning
}
}

 

 

BR,

Ishan

View solution in original post

4 Replies

Avatar

Community Advisor

Hello @Anushka_RK 

 

Did you try this?

 

rtEvent.ctx.information.paragraph

rtEvent.ctx.information.status 

 

You can use conditions for alert like this

if(rtEvent.ctx.information.status=='red'){
PRINT ALERT HERE
}

     Manoj
     Find me on LinkedIn

Avatar

Level 3

Hi @_Manoj_Kumar_ ,

 

Thank you for your response.

Yes, I tried this. But the <information> node is dynamic and the number of information nodes might vary each time.

How can I pull all the details for each <information> node?

 

Kind Regards,

Anushka RK

Avatar

Correct answer by
Community Advisor

Hi @Anushka_RK,

 

You can do it like this:

 

 

var infos = rtEvent.ctx.information;
for each (var info in infos){
if(info.status.toString() == "red"){
//alert
}
if(info.status.toString() == "yellow"){
//warning
}
}

 

 

BR,

Ishan

Avatar

Level 2

Hi @isahore,

Thank you for your response.

It worked!

Kind Regards,

Anushka RK