Contextual field with Helper function | Community
Skip to main content
October 6, 2025
Question

Contextual field with Helper function

  • October 6, 2025
  • 3 replies
  • 589 views

I am facing some error when adding contextual field in function while trying to do some personalization in email with in a journey. 

Any idea on what could be the resolution for this ?

3 replies

Mohan_Dugganab
Adobe Employee
Adobe Employee
October 6, 2025

Kindly use back ticks for the event Id 

Example -> context.journey.events.`1792665356`........
riyaAAuthor
October 6, 2025

don't think that is correct syntax.

 

 

 

Mohan_Dugganab
Adobe Employee
Adobe Employee
October 6, 2025
Ok some confusion, will explain again. I need to use below syntax in email. i am not able to pass context field as replaceAll expecting string. So original question how do i pass context field here
 
{%= replaceAll(context.journey.events.923737463.Event.test.totalPrice, "([0-9]+\\.[0-9]{2}).*", "$1") %}

Use it on the following lines as mentioned previously as traject is an array object and it needs to be iterated over. eventId needs to have backticks.

Example {{#each context.journey.events.`eventId`._tenant.npoEvent.traject as |s|}} {%= replaceAll(s.discountedPrice,"([0-9]+\\.[0-9]{2}).*","$1") %} {{/each}}

 

Mayank_Gandhi
Adobe Employee
Adobe Employee
October 6, 2025

@riyaa 

Can you Reference contextual fields directly?

{{context.journey.events.923737463.LEAD_88_8_05.discountedPrice}}

 

Sukrity_Wadhwa
Community Manager
Community Manager
October 17, 2025

Hi @riyaa,

Were you able to resolve this query with the given solution or was this something you were able to figure out on your own or do you still need help here? Do let us know.

Thanks!

Sukrity Wadhwa