Passing Discovery Pattern variables to a pattern step using Javascript

Bob Mullineaux
Tera Contributor

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?

2 REPLIES 2

ZacharyKenyon
Kilo Guru

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}

 

 

Community Alums
Not applicable

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