Expand my Community achievements bar.

Adobe Journey Optimizer Community Lens 6th edition is out.
SOLVED

Sample of using if condition in advance mode in an action

Avatar

Level 3

Hello Experts,

 

I'm trying to update a mobile number format using journey.

I want to add multiple conditions, like

if mobile number 0023456789 then update +23456789 in new_mobile column,

if mobile number 023456789 then update +23456789 in new_mobile column etc.

 

trying with some syntax:

if substr(mobile_number,0,2) == '00', '+' +substr(mobile_number,2,15),

 

Could someone please help how can I ingest value in one filed using conditions in other field.

1 Accepted Solution

Avatar

Correct answer by
Employee

Try validating it on the following lines 

 

if (substr(#{ExperiencePlatform.ProfileFieldGroup.profile.mobilePhone.number},0,2) == '00')
	then ('+'+(substr(#{ExperiencePlatform.ProfileFieldGroup.profile.mobilePhone.number},2,length(#{ExperiencePlatform.ProfileFieldGroup.profile.mobilePhone.number}))))
else (
	if ( (substr(#{ExperiencePlatform.ProfileFieldGroup.profile.mobilePhone.number},0,1) == '0'))
		then ('+'+(substr(#{ExperiencePlatform.ProfileFieldGroup.profile.mobilePhone.number},1,length(#{ExperiencePlatform.ProfileFieldGroup.profile.mobilePhone.number}))))
	else (
		#{ExperiencePlatform.ProfileFieldGroup.profile.mobilePhone.number}
	)
)

 

View solution in original post

2 Replies

Avatar

Correct answer by
Employee

Try validating it on the following lines 

 

if (substr(#{ExperiencePlatform.ProfileFieldGroup.profile.mobilePhone.number},0,2) == '00')
	then ('+'+(substr(#{ExperiencePlatform.ProfileFieldGroup.profile.mobilePhone.number},2,length(#{ExperiencePlatform.ProfileFieldGroup.profile.mobilePhone.number}))))
else (
	if ( (substr(#{ExperiencePlatform.ProfileFieldGroup.profile.mobilePhone.number},0,1) == '0'))
		then ('+'+(substr(#{ExperiencePlatform.ProfileFieldGroup.profile.mobilePhone.number},1,length(#{ExperiencePlatform.ProfileFieldGroup.profile.mobilePhone.number}))))
	else (
		#{ExperiencePlatform.ProfileFieldGroup.profile.mobilePhone.number}
	)
)