Expand my Community achievements bar.

Join expert-led sessions on Real-Time CDP & Journey Optimizer designed to boost your impact.
SOLVED

unable to pass variable inside the function

Avatar

Level 4

Hi Team,

I'm trying to dynamically set the locale in the formatCurrency() function in Adobe Journey Optimizer. Here's a simplified version of what I'm doing:

{%= formatCurrency(10000, "en_AU") %}

Instead of hardcoding "en_AU", I would like to pass a profile attribute (e.g., {{countryCode}} or profile.countryCode) that represents the locale dynamically.

However, when I try to pass an attribute like this:

{%= formatCurrency(10000, profile.countryCode) %}

I receive an error.

Could you please confirm if passing a dynamic attribute for the locale parameter is supported in AJO expressions? If so, what is the correct way to structure this?

 

@SatheeskannaK @Mohan_Dugganab @AJODev @DavidKangni @Anuhya-Y 

1 Accepted Solution

Avatar

Correct answer by
Level 5

Hello @Ajo_WisdomChase , 

 

I think we cant give dynamic locales in AJO expressions instead you can code with if else condition with country codes.

I know it is not feasible way to do or add in personalization. if you know the data that how many country codes are included, if you want you can format into if else condition.

 

Thanks

AJODev

View solution in original post

2 Replies

Avatar

Correct answer by
Level 5

Hello @Ajo_WisdomChase , 

 

I think we cant give dynamic locales in AJO expressions instead you can code with if else condition with country codes.

I know it is not feasible way to do or add in personalization. if you know the data that how many country codes are included, if you want you can format into if else condition.

 

Thanks

AJODev

Avatar

Administrator

Hi @Ajo_WisdomChase,

Was the given solution helpful to resolve your query or do you still need more help here? Do let us know. In case the given solution was helpful, then kindly choose it as the 'Correct Reply'.

Thanks!



Sukrity Wadhwa