Transform map question
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-30-2024 03:32 PM
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?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-30-2024 03:59 PM
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;
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-31-2024 06:06 AM
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 :
I hope you find this helpful.
Best regards,
Hajar