Using FormatEncryptString function for email address in CA TDM portal data generation. we are getting below error
contains a mismatched bracket in expression: @formatencryptstring([email protected])@
Release : 4.9.x
Component : TDM Portal
FormatEncryptString being a code type of function cannot work with extra "@" symbols and is expectedly throwing the error.
Below is a complex workaround using some inbuilt functions to identify position of @ symbol, extract the left side and right side of @ symbol, then mask these with two calls to formatencryptstring function.
@formatencryptstring(@left(^COL_NAME^,@subtract(@pos(^COL_NAME^,@atsign()@)@,1)@)@)@@atsign()@@formatencryptstring(@right(^COL_NAME^,@subtract(@length(^COL_NAME^)@,@pos(^COL_NAME^,@atsign()@)@)@)@)@
If above workaround doesn't work then you have to look at other functions(may be in combination) to meet your masking requirements.