Find your people. Pick a challenge. Ship something real. The CreatorCon Hackathon is coming to the Community Pavilion for one epic night. Every skill level, every role welcome. Join us on May 5th and learn more here.

Passing Discovery Pattern variables to a pattern step using Javascript

BobMullinea
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}

 

 

Not applicable

hi @BobMullinea , 

 

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