Unable to update sys_user Name-Value Pairs field from Flow Designer Custom Action
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
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:
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago - last edited 3 weeks ago
Hi @riyaz199708
-
Please add some backtracking logs to identify where the execution is breaking.
-
Could you check whether your Script Include is being invoked before the record is updated?
-
Please try passing only the required input parameters instead of the entire GlideRecord object in the request, and verify the output. Also, add backtracking logs to trace the execution.
-
From what I can see, your Script Include is not returning any value, so nothing is being captured in the output variable.
-
Please check whether there are any Business Rules, Flows, or other server-side scripts that are aborting the record update. You can use the Script Debugger to verify this.
Please let me know if you need any further assistance.
If my answer has helped with your question, please mark my answer as accepted solution and give a thumb up.
Thank You