Transform script validate User Active True or False

Ram050670
Tera Guru

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.

 

Naneen_0-1697830277701.pngNaneen_1-1697830328180.png

 

1 ACCEPTED SOLUTION

SanjivMeher
Mega Patron

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
}

 

View solution in original post

9 REPLIES 9

I dont think, unless you are using scripted rest api.

In the scripted rest api, you can validate the data even before transforming it.

can you help me write Scripted rest api?

 

Thanks for your response, but i am trying to look for user active status when i use rest api in order to avoid create INC for inactive user and i want to get error info mesg on that response.