- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-06-2025 04:14 AM
Hi All,
i have a flow for decomissioning a pc, the flow should kick off if an update is done from AD on the computer table.
when the computer gets disabled in AD and this information gets updated in servicenow, the flow should kick of and created the requested item that is attached to the flow.
users are also able to manually create the request but when the request is created automatically the approval in the flow should be skipped.
im not sure how to start is there anyone who can hellp me on the way
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-06-2025 05:35 AM
I don't think you can pass any other input to flow
You can do this
1) create a hidden variable on your catalog item and set it via onLoad with some value and hide that variable always
2) then check that variable value in your flow
3) if it has value then it means it is submitted via manual request
4) when flow triggers via BR this variable will be empty
This will help you to skip approval
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-06-2025 04:39 AM
you can use after update BR and check in the condition if it was manually triggered in an interactive session or not
Then trigger flow
Condition: Field Logic
Script:
(function executeRule(current, previous /*null when async*/ ) {
// Add your code here
if (!gs.getSession().isInteractive()) {
try {
var inputs = {};
inputs['current'] = ; // GlideRecord of table:
inputs['table_name'] = 'incident';
// Execute Synchronously: Run in foreground.
// var timeout = ; //timeout in ms
//sn_fd.FlowAPI.executeFlow('global.test_flow', inputs, timeout)
sn_fd.FlowAPI.executeFlow('global.test_flow', inputs);
} catch (ex) {
var message = ex.getMessage();
gs.info(message);
}
}
})(current, previous);
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-06-2025 04:48 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-06-2025 04:53 AM
when triggered via script you can pass an input to flow via script and based on that input you will know if approval has to be skipped or not
To handle this you can use IF logic and check the value of input
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-06-2025 05:16 AM
apologies but i need some help on that one.
i have this now: