I want to stop Transform by checking the value of the field of the first record in Transform Map.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-07-2018 09:44 PM
Hi Everyone,
I want to stop Transform by checking the value of the field of the first record in Transform Map.
Since OnStart has not read records yet, it can not be determined.
Can I recognize the first record on OnBefore? Is there any other good way?
regards.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-07-2018 09:58 PM
You can have the ignore = true; after checking the value of first record in source to stop the entire transformation.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-07-2018 10:08 PM
Hi Shishir,
Is ignore = true only by ignoring the current record?
Also, how we you judge the first record?
regards.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-07-2018 10:54 PM
You want to check a particular value of the Source record? I believe the transformation start from the first source record.
OnStart()
Ignore | Boolean Flag | When set to true, the entire transformation will be stopped and no further processing will occur. |

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-07-2018 10:11 PM
Hi Chanken,
Use onBefore Transform map script and write code as following example :
if(source.u_field1 == '') // Put your condition to check here
{
ignore = true; //ignores tranformation of the row if condition matches
}
For more information on Transform map script and execution order please refer the following blog :
http://www.john-james-andersen.com/blog/navigating-transform-scripts-in-servicenow.html
Mark if correct
Regards
Ajay
www.dxsherpa.com