Problem of values mapping with regex.


Question:

I am attempting to modify the Contact Email before inserting or updating it in the target organization by replacing ".", "-", and "@" with "_". However, my regex doesn't seem to find any records to update. I even tried using JavaScript evaluation, but had no luck. My regex looks correct; what could be the issue?

Here is what my ValueMapping.csv looks like:

ObjectName,FieldName,RawValue,Value
Contact,Identite_digitale__c,2,1
Contact,Email,/([.,@-]+)/,_

Answer:

The issue stems from your regex expression not being enclosed in double quotes, which is necessary for it to be recognized as a single string value. The presence of a comma within your regex expression is misleading the Plugin, causing it to interpret "/([." and "@-]+)/" as two separate values for different columns. Here is the corrected format:

ObjectName,FieldName,RawValue,Value
Contact,Identite_digitale__c,2,1
Contact,Email,"/([.,@-]+)/",_

It is strongly recommended to enclose all values in your CSV in double quotes to prevent similar issues.

Last updated on 20th Apr 2024