Unable to update sys_user Name-Value Pairs field from Flow Designer Custom Action

riyaz199708
Giga Contributor

Hi All,

I have a catalog item where, on submission, I need to take the value of a catalog variable ("I request an exception until" (which is a date type field)) and update the Requested For user's u_sn_attributes field on the sys_user table. The field type is Name-Value Pairs, and I need to create/update as USBEndDate .

I'm calling a Script Include from a Flow Designer Custom Action to update the user record.

 

Error message from flow:

FAILED TRYING TO EXECUTE ON CONNECTION glide.5 (connpid=3146779): INSERT INTO sys_user

Can someone please help me on this?

Script include:

var RemovableMediaDeclarationHandler = Class.create();
RemovableMediaDeclarationHandler.prototype = {
initialize: function() {
},

updateUsbEndDate: function(current) {

var userInfo = current.request.requested_for;

var userGR = new GlideRecord('sys_user');
if (userGR.get(userInfo)) {

userGR.u_sn_attributes.USBEndDate = current.variables.i_request_an_exception;

userGR.update();
}
},

type: 'RemovableMediaDeclarationHandler'
};

 

Custom Flow Action script:

riyaz199708_0-1782399409237.png

 

riyaz199708_1-1782399455723.png

 

 

 

 

0 REPLIES 0