- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-20-2023 12:32 PM
Hi All, i am trying to find a solution for validate User ID active or not in Transform.
can someone help me if we can validate that using run script on the transform.
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-20-2023 12:39 PM
You can create a onBefore Transform script and create a query to check if the called id is valid. If not, if you want to ignore, you can set ignore=true. Below is an example.
var user = new GlideRecord('sys_user');
user.addQuery('user_name',source.u_caller_id);
user.query();
if (user.next() && user.active!='true')
{
ignore=true
}
Please mark this response as correct or helpful if it assisted you with your question.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-20-2023 12:39 PM
Hi Naneen,
In the script field of the Table Transform map form you can try adding
if(target.u_caller_id.active==false ||target.u_caller_id.active=='false')
{
ignore=true;
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-20-2023 12:57 PM
is it possible to get the error message sent to rest api back that the user is inactive?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-20-2023 12:39 PM
You can create a onBefore Transform script and create a query to check if the called id is valid. If not, if you want to ignore, you can set ignore=true. Below is an example.
var user = new GlideRecord('sys_user');
user.addQuery('user_name',source.u_caller_id);
user.query();
if (user.next() && user.active!='true')
{
ignore=true
}
Please mark this response as correct or helpful if it assisted you with your question.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-20-2023 12:58 PM
is it possible to get the error message sent to rest api back that the user is inactive?