Passing Discovery Pattern variables to a pattern step using Javascript
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-11-2025 04:32 AM
Is there a way to pass a Discovery Pattern variable to a Step using javascript? e.g. passing information obtained in a prior step such as the $WIN32_ComputerSystem.UserName to the javascript in the next step?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-11-2025 08:40 AM
Yes, you can access the individual variables in the result of a WMI query in a Javascript step such as an EVAL() block.
In an EVAL() block you'd access it using ${Win32_ComputerSystem.UserName}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-11-2025 09:32 AM
hi @Bob Mullineaux ,
Here are the few example of how EVAL scripts work in the patterns. Please take a look the below kb article.
https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB0647736
Regards,
Srinija