Create a custom Flow action to Update Record with Workflow(false)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-14-2025 11:20 PM
I am trying to create a custom flow action for Update Record with setWorkflow(false).
Similar to the OOB action, I have added three inputs:
Table (type Table Name)
Record (type Document ID, dependent on Table)
Fields (type Template Value, dependent on Table)
I am using a custom script step with the following code, where setWorkflow(false) does not seem to work. Does anyone have any suggestions please.
Note: The input.fields is in this format:

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-15-2025 10:32 AM - edited ‎01-15-2025 10:32 AM
You need to capitalize the word flow in the function call, so it should be gr.setWorkFlow(false), you have gr.setWorkflow(false)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-15-2025 02:46 PM
Thanks Zach for your response, but it does not work.
Also, the correct syntax is gr.setWorkflow() [without the upper case].
Thank you!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-16-2025 06:38 AM
Hi @daisybora,
I think there are two things at play here:
1. Move the setWorkflow(false) before your query statement
2. You values in applyEncodedQuery should look like this instead:
var grAsset = new GlideRecord('alm_asset');
grAsset.addEncodedQuery('sys_id=' + '17c1fa8837f3100044e0bfc8bcbe5d61');
grAsset.setLimit(1);
grAsset.setWorkflow(false);
grAsset.query();
if (grAsset.next()) {
grAsset.applyEncodedQuery('install_status=1^stockroom=2eaa2b3f3763100044e0bfc8bcbe5de2');
grAsset.update();
}
gs.info(grAsset.stockroom.getDisplayValue());
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-16-2025 07:06 AM
I verified setWorkflow(false) does work with applyEncodedQuery()
try with this input
install_status=1^stockroom=1d62222bdb9c08d0d9268e3505961970
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader