Unable to convert the ACC JS logic to AJO PQL Query logic | Community
Skip to main content
Level 2
October 1, 2025
Solved

Unable to convert the ACC JS logic to AJO PQL Query logic

  • October 1, 2025
  • 3 replies
  • 318 views

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": ""
}
],

Best answer by Mohan_Dugganab

@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}}

 

3 replies

SatheeskannaK
Community Advisor
Community Advisor
October 1, 2025

@nutsa9858 Try along these lines,

{#each context.eventinfo.sections as |section|}}
{%#if section.display_name = "dealer information" AND contains(section.first_name, "DLR_") %}
<p>Dealer Bucket: {{section.display_name}}</p>
<p>Dealer Section: {{section.first_name}}</p>
{%/if%}
{{/each}}
Take a look at this documentation,
Use this personalization editor to tryout and see how it works, https://experienceleague.adobe.com/en/apps/journey-optimizer/ajo-personalization?lang=en
Thanks, Sathees
Mohan_Dugganab
Adobe Employee
Mohan_DugganabAdobe EmployeeAccepted solution
Adobe Employee
October 3, 2025

@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}}

 

Sukrity_Wadhwa
Community Manager
Community Manager
October 17, 2025

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!

Sukrity Wadhwa
Nutsa9858Author
Level 2
October 21, 2025

Hi @sukrity_wadhwa ,

Well Im able to resolve the logic thanks for the lookup!