Sample of using if condition in advance mode in an action | Community
Skip to main content
Level 3
April 23, 2024
Solved

Sample of using if condition in advance mode in an action

  • April 23, 2024
  • 1 reply
  • 1133 views

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.

Best answer by Mohan_Dugganab

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

 

1 reply

Mohan_Dugganab
Adobe Employee
Mohan_DugganabAdobe EmployeeAccepted solution
Adobe Employee
April 23, 2024

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

 

ShivaniMAuthor
Level 3
April 23, 2024

Thank you so much for such quick response!