Update user record from workflow?
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-20-2022 06:53 AM
Hello everyone,
I have a catalog item with a workflow attached.
After one of the tasks is closed in the workflow, I need to update the sys_user table (user record). There is a checkbox field called "sensitive_employee" that I want to be checked.
So on the catalog item form, there is a "Requested For" variable, and the user record for that person is where this update needs to happen.
So far I have a run script activity in the workflow that looks like this, but now luck. Any ideas? thanks!
var gr =new gliderecord("sys_user");
var ga = "u_sensitive_employee";
ga.setValue("u_sensitive_employee", 'true');
gr.update();
5 REPLIES 5

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-20-2022 07:02 AM
Hello,
Here is the script
var requestedfor= current.variables.requested_for;
var gr= new GlideRecord("sys_user");
gr.addQuery('sys_id', requestedfor);
gr.query();
if(gr.next()){
gr.u_sensitive_employee = true;
gr.update();
}
Please hit like and mark my response as correct if that helps
Regards,
Musab
Regards,
Musab