Modify users level customproperties in email template

Harish_Yara
New Contributor III
New Contributor III

Hi All,

Can someone pls help how to substring user's customproperty in email template.

For example - customproperty44 is having string value as "abc.xyz@domain.com"

Requirement is to pass username in template as "abcxyz" from customproperty44 [Here dot is removed in between abc & xyz and also "@domain.com" is removed. 

@rushikeshvartak 

Thanks,

Harish

 

Thanks,

Harish

6 REPLIES 6

Sivagami
All-Star
All-Star
${user.customproperty44.substring(0, user.customproperty44.lastIndexOf('@')).replace('.','')}

Please handle null pointer exception in case cp44 is blank

Harish_Yara
New Contributor III
New Contributor III

Thank you @Sivagami it worked.

Harish_Yara
New Contributor III
New Contributor III

Hi @Sivagami  @rushikeshvartak  

Can u please help me in replacing dot with comma+space

For example  abc.xyz should be replaced with comma and space like abc, xyz in CN of AD account (Account Name Rule)

Tried with CN=${user.customproperty1.replace('.','\\, '),OU=abc,DC=xyz,DC=com} but it is giving error Invalid Argument while AD account creation.

Thanks,

Harish

CN=${user.customproperty1.replace('.',',').replace(' ','')},OU=abc,DC=xyz,DC=com

Try below

CN=${user.customproperty1.replace('.',', ')+',OU=abc,DC=xyz,DC=com'}

 


Regards,
Saathvik