Show error message in the target record using transform map
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-16-2024 12:18 AM
Hi,
The requirement here is that the transform should not happen when the mandatory fields are missing from the excel (which can be achieved by enforce mandatory fields), when these type of records are ignored by the transform we need to show a error message that "The import has missing mandatory fields" in the target record. How can we achieve this?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-16-2024 04:06 AM
Have you tried using the onBefore Transform scripts? You can refer this page to achieve your use case. For example, if in the `source` object you do not find the required fields present, you can update using the `target` object and abort the action. More information here.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-16-2024 05:20 AM
Hi,
If you want to check this for each individual record or each individual line in the Excel file.
I would write an on Before Transform script and check for these fields with a script before each "Transform line" (field != '')
if the result is false, you could fire an event and write a mail or something else.
If the goal is a one-time check.
After the transform, I would go through the import table (glider record) in an On COmplete Transform script and search for empty fields.
If there is one, you could write another mail.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-17-2024 02:31 AM
Hi,
Can you please provide the sample script for the OnComplete transform script using gliderecord?
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-17-2024 03:19 AM
// Read all records of the current import set again
var grImport = new GlideRecord('your import table');
grImport.addQuery('sys_import_set',import_set.sys_id);
grImport.query();
while(grImport.next()) {
if (grImport.getValue("yourfield") == '')
//do something
}