FormatEncryptString function is not supporting email address
search cancel

FormatEncryptString function is not supporting email address

book

Article ID: 228315

calendar_today

Updated On:

Products

CA Test Data Manager (Data Finder / Grid Tools)

Issue/Introduction

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])@

Environment

Release : 4.9.x

Component : TDM Portal

Cause

FormatEncryptString being a code type of function cannot work with extra "@" symbols and is expectedly throwing the error.

Resolution

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.