I'm Currently working on API Triggered campaign with in AJO and migrating Adobe V7 Realtime message center campaigns to AJO, when I'm trying to replicate the below JavaScript logic from ACC to AJO
Help me with any references or code snippets to transfer below ACC logic to AJO PQL Query logic
Logic:
<% var sections = rtEvent.ctx.complexVariables.sections;
for each (var section in sections){
if(section.sectionName.toString().toLowerCase() == "dealer information" && section.bucketName.toString().indexOf("DLR_") != -1)
{
var dealerBucketName = section.bucketName.toString();
var dealerSectionName = section.sectionName.toString().toLowerCase();
}
else if(section.sectionName.toString().toLowerCase() == "dealer information" && section.bucketName.toString().indexOf("DLR_") == -1){
var dealerBucketName = '';
}
}%>
Expected API JSON Payload:
"context": {
"eventinfo": {
"sections": [
{
"sectionName": "Pressure",
"bucketName": "TPM_4",
"status": "GREEN"
},
{
"sectionName": "Maintenance",
"bucketName": "SM_6",
"status": "GREEN"
},
{
"sectionName": "Recall",
"bucketName": "RC_X",
"status": ""
},
{
"sectionName": "Information",
"bucketName": "DLR_3",
"status": ""
},
{
"sectionName": "Service Plan",
"bucketName": "DC",
"status": "GREEN"
},
{
"sectionName": "Connected Plan",
"bucketName": "C0",
"status": "GREEN"
},
{
"sectionName": "SiriusXM",
"bucketName": "0",
"status": ""
},
{
"sectionName": "Data Plan",
"bucketName": "WD_0",
"status": ""
}
],
Solved! Go to Solution.
Topics help categorize Community content and increase your ability to discover relevant content.
Views
Replies
Total Likes
@Nutsa9858 You can use the following snippet and use the respective variables for personalization.
{{#each context.eventinfo.sections as |s|}}
{%#if lowerCase(s.sectionName)= "dealer information"
and indexOf(s.bucketName, "DLR_") != -1 %}
{%let dealerBucketName = s.bucketName %}
{%let dealerSectionName = lowerCase(s.sectionName) %}
{%else if lowerCase(s.sectionName)= "dealer information"
and indexOf(s.bucketName, "DLR_") = -1 %}
{%let dealerBucketName = "" %}
{%/if%}
{{/each}}
@Nutsa9858 Try along these lines,
@Nutsa9858 You can use the following snippet and use the respective variables for personalization.
{{#each context.eventinfo.sections as |s|}}
{%#if lowerCase(s.sectionName)= "dealer information"
and indexOf(s.bucketName, "DLR_") != -1 %}
{%let dealerBucketName = s.bucketName %}
{%let dealerSectionName = lowerCase(s.sectionName) %}
{%else if lowerCase(s.sectionName)= "dealer information"
and indexOf(s.bucketName, "DLR_") = -1 %}
{%let dealerBucketName = "" %}
{%/if%}
{{/each}}
Hi @Nutsa9858,
Were you able to resolve this query with the help of the provided solutions, or do you still need further assistance? Please let us know. If any of the answers were helpful in moving you closer to a resolution, even partially, we encourage you to mark the one that helped the most as the 'Correct Reply.'
Thank you!
Views
Replies
Total Likes
Hi @Sukrity_Wadhwa ,
Well Im able to resolve the logic thanks for the lookup!
Views
Likes
Replies
Views
Likes
Replies
Views
Likes
Replies