Transform map question

samadam
Kilo Sage

I have a transform map with coalescing on email. When an email is not found it is still creating records. I set the Choice option for this field to ignore. Even then it is creating the record. How can I fix this?

 

2 REPLIES 2

Gangadhar Ravi
Giga Sage
Giga Sage

it should work actually, you can try  onBefore script runs before the transformation logic is executed, which gives you the opportunity to check if a matching record exists in the target table and decide whether to create a new record.

 

 

// Retrieve the email from the source table
var email = source.email;

// Check if the email exists in the target table
var gr = new GlideRecord('target_table_name'); // Replace with your target table name
gr.addQuery('email', email);
gr.query();

if (!gr.next()) {
    // If no matching record is found, skip the record creation
    ignore = true; 
}

 

Hajar BENJAHHAR
Mega Sage

Hello @samadam , 

 

Create onBefore transform script that checks if it's an insert or update , if it's an insert then tell the transform map to ignore it. Refere to the screenshot below : 

 

Capture d'écran 2024-08-31 150306.png

 

I hope you find this helpful.

Best regards, 

Hajar