Expand my Community achievements bar.

SOLVED

AddMonth function used to aggregate 1 months in AJO helper function

Avatar

Level 3

Hi,

 

I am using it:

{%= addMonths(profile._deloittellpcanada.abnMemberDetails.tsExpect_date, 1) %}

simply want to add 1 month to tsExpect_date but action failed because of it.

 

the expect_date format is as 2024-12-04T00:00:00Z. 

 

can you help me out to troubleshoot it?

 

Thank you.

1 Accepted Solution

Avatar

Correct answer by
Employee

There is a runtime rendering error, kindly log a support ticket for this

View solution in original post

9 Replies

Avatar

Community Advisor

@chrisyan 

Try this

Input: {%= addMonths(stringToDate("2024-12-04T00:00:00Z"),1) %}
Validation: {%= addMonths(toDateTimeOnly(profile._deloittellpcanada.abnMemberDetails.tsExpect_date,),1) %}

 

Thanks,

David



David Kangni

Avatar

Level 3

no luck here, by the way my date is already defined as datetime with format as 2024-12-04T00:00:00Z why to use ToDatetimeOnly function

Avatar

Community Advisor

@chrisyan 

 

I tested again and it's working for me.

by the way my date is already defined as datetime with format as 2024-12-04T00:00:00Z why to use ToDatetimeOnly function? -->

Personalization in AJO is based on the templating syntax called Handlebars. Handlebars.js treats all values as strings by default because it doesn’t have built-in type awareness like JavaScript. This means that even numbers, booleans, or objects will be coerced into strings when rendered in a template. Hence you need to convert it when using helper functions

DavidKangni_0-1739482353140.png

 

DavidKangni_1-1739482473162.png

Thanks,

David



David Kangni

Avatar

Level 3

Thank you, but still have errors

chrisyan_0-1739484741034.png

 

Avatar

Employee

Can you share what error you get when you directly use

{%= addMonths(profile._deloittellpcanada.abnMemberDetails.tsExpect_date, 1) %} ? This should ideally work as it's a datetime from the below example

 

Mohan_Dugganab_0-1739507666587.png

 

Mohan_Dugganab_1-1739507864723.png

 

 

Avatar

Level 3

I used below with no error detected:

chrisyan_1-1739560891927.png

 

then published the DM campaign then telling me:

chrisyan_0-1739560821697.png

no idea what's going on and is there any details of error log could help?

Avatar

Employee

can you query ajo_message_feedback_event_dataset dataset filtering on _experience.customerJourneyManagement.messageExecution.campaignID column to see if there is any error reported ?

Avatar

Level 3

chrisyan_0-1739846209096.png

 

Avatar

Correct answer by
Employee

There is a runtime rendering error, kindly log a support ticket for this