
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-03-2018 09:54 AM
In Flow Designer, is it possible to change who performs the update record actions? In my instance i want all the scheduled job update record actions to be performed by system administrator instead of myself. Ive attempted to use "updated by" field in the update actions to system admin but it still logs all my changes in the activity flow as myself.
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-03-2018 11:40 AM
Unfortunately thats not available in the out of the box update action in Flow Designer.
Fortunately i figured it out with a workaround!
I created two Actions in flow designer
RunAsAdmin Start and RunAsAdmin End
RunAsAdmin Start has no input variables, created 1 output variable; sysUser with a string parameter
it just has a script step
(function execute(inputs, outputs) {
//impersonate system admin
var runAdmin = gs.getSession().impersonate('98b039ef0a0a3d2800b10b5352f375eb');
outputs.sysUser = runAdmin;
})(inputs, outputs);
after this action, i ran my update record action followed by RunAsAdmin End
I used the output.sysUser data pill as an input variable, sysUser with string parameter
(function execute(inputs, outputs) {
//return to previous user context
gs.getSession().impersonate(inputs.sysUser);
})(inputs, outputs);
I just ran and tested this and worked as i hoped for. I will continue to test to see if it breaks in anyway.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-03-2018 10:04 AM
I'm pretty sure this works like any other business rule or workflow. The operation will happen under the context of the user that triggered the action (which is exactly what you want). Have you tested with a different user to see if it's really always running as you?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-03-2018 10:12 AM
in our environment we have some scheduled script executions with an option to run the scheduled job as another user, our system admin. The flow ive created in the designer is triggered by a schedule of every wed at noon. It updates multiple change request records. We would prefer my name not appear on each updated change request activity log.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-03-2018 10:15 AM
Okay, if it's triggered from a scheduled job then you can just add the 'Run as' field to the scheduled job form. Blanking it out will cause everything to run as system if you'd prefer that.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-03-2018 11:40 AM
Unfortunately thats not available in the out of the box update action in Flow Designer.
Fortunately i figured it out with a workaround!
I created two Actions in flow designer
RunAsAdmin Start and RunAsAdmin End
RunAsAdmin Start has no input variables, created 1 output variable; sysUser with a string parameter
it just has a script step
(function execute(inputs, outputs) {
//impersonate system admin
var runAdmin = gs.getSession().impersonate('98b039ef0a0a3d2800b10b5352f375eb');
outputs.sysUser = runAdmin;
})(inputs, outputs);
after this action, i ran my update record action followed by RunAsAdmin End
I used the output.sysUser data pill as an input variable, sysUser with string parameter
(function execute(inputs, outputs) {
//return to previous user context
gs.getSession().impersonate(inputs.sysUser);
})(inputs, outputs);
I just ran and tested this and worked as i hoped for. I will continue to test to see if it breaks in anyway.