How to run multiple javascript snippets in ServiceNow with delay between each
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-16-2024 05:29 AM
After a patch or family upgrade, i have found serveral things i have to get back to normal.. I did this manually in the beginning, but now i have scripts that do each task for me. I now want to automate better. I am looking for a way to run the first script, then wait, then run the next script, then the next, etc. I actually tried a powershell script to run each javascript script, but seems i have errors on GlideRecord, GlideSystem, etc.
I appreciate the help you can give !!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-17-2024 12:54 AM
Hi @northfdl54937 ,
You can run your scripts in your custom flow actions, with the help of Flow Designers adding a Wait for Duration btw each action.
FYI
https://docs.servicenow.com/csh?topicname=flow-logic-wait-for-a-duration.html&version=latest
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-18-2024 12:41 PM
I haven't figured out how to do that actually... could you provide steps on how you think it would be done? I have 8 scripts that i would love to run with a timer in between, so that the gs.info comes in in the specified order. I can't see how that would be done in flow designer...