Chuck Tomasi
Tera Patron


expert-logo-2.pngHunting down bugs can be a real time killer. Find out how you can develop complex solutions faster using a scripting debugger in this fun, informative webinar.

Quick tip:Description field on business rules
(Be sure to change your YouTube Setting to 720HD)

Ask your questions below on this discussion page.

And Please Let our Experts know how they've helped! Comment Below!

Find More Events on the Community!

Originally aired July 10, 2018


Featured Experts

find_real_file.pngChuck Tomasi is a Sr. TPMM for ServiceNow. He is a computer science major with over 35 years of IT experience. As a former ServiceNow customer, Chuck won the first Innovation of the Year Award at Knowledge 10. Since joining ServiceNow in 2010 as a Technical Consultant, he has done many large scale ITSM implementations and custom applications, acted as an adjunct instructor for Education Services, created and lead the Technical Best Practices program, makes appearances on Live Coding Happy Hour, created dozens of fit for purpose custom applications, and co-hosts the ServiceNow series "TechNow".

 

find_real_file.pngKreg Steppe is a Senior Curriculum Developer within ServiceNow developing and supporting cloud training infrastructure. He specializes in developing integration solutions, automating repeatable processes and Cloud Management in ITOM. Kreg's prior experience includes operating his own ISP, developing web applications in PHP, network integration, managing network support, Application Development on cloud based networks, DNS and email server maintenance. He is a Linux enthusiast and enjoys Photography.

 

find_real_file.pngStacey Bailey is a Principal Curriculum Developer for ServiceNow with over 20 years of IT experience in various roles. Since 2009 she has been working with the ServiceNow platform customer, partner, and employee. She has earned numerous awards in her career including: ITSM MVP 2017, InfoWorld Top 100 Award, DCI Portal Excellence Award, Financial Times Award for Excellence in E-Learning. Stacey proudly refers to herself a s a "gadget girl". In her spare time she likes trying new gadgets, learning new forms of art, playing in the makerspace, collecting new / unique skills, listening to audio-books, trying new life experiences, and hosting parties to build communities.

 


5 Comments
Chuck Tomasi
Tera Patron

Questions and answers from the live broadcast:


So, after the issue is resolved, you don't have to go back and clear the breakpoints? Leaving them there is ok? -- Virgil Allen
This will work on global and scoped applications as long as the code is run server-side as the current, interactive user. -- Stacey Bailey

perfect, thanks a ton -- Sharan Tej Kodumuru
You are welcome! -- Kreg Steppe

Are you reviewing which area of he platform you can't use the script debugger? For example, script debugger didn't work with inbound action scripts, scoped apps, etc in the past. -- Jack Zheng
Yes, we covered it. Scoped vs. global is not an issue. It's all about interactive, server side scripts. -- Chuck Tomasi

adding an existing field to the Business Rules form gets blown away for a version upgrade? Really? -- David Forbes
No. That's not what happens. Once you configure the form, you own it. The upgrades never destroy work you've done, only flag it. -- Chuck Tomasi

Will the script debugger work on inbound action scripts? -- Jeff Thurston
Inbound actions execute as the system, so the script debugger will not work on those. -- Stacey Bailey

this is my first technow session, how can I get the latest updates to get registered in to more sessions? Also, where can I get some practical sessions with integrations, Orchestration -- Sharan Tej Kodumuru
You can get invites to future sessions by joining the developer community. Just create an account at developer.servicenow.com and you'll stay informed. As for Orchestration, we offer courses on that. Have a look at our training page on servicenow.com -- Chuck Tomasi

How would I learn servicenow as a job qualification? Currently, I don't work at a company that uses servicenow. -- Eva M
You can sign up for a free personal developer instance and learning plans at developer.servicenow.com -- Chuck Tomasi

is it possible to use it on calculated field's scripts ? -- Helio Gabrenha Jr
Not at this time. They are run in the background, not as part of an interactive session. Great idea though! -- Chuck Tomasi

would this run on display/query Business rules ? -- vyjayanth uttanoor
Yes -- Chuck Tomasi

Do you need to install debugger in prod as well as dev and test? -- Steven Bogart
It is already there by default in SN. -- Kreg Steppe

Is it planned to extend the debugger to work with workflow scripts? -- Robert Bigelow
I do not know if there are plans for that but I can see where they may in the future. I know you can set break points. 🙂 -- Kreg Steppe

I have missed the part, on how the script debugger is used to put break points on a business rule or script include? -- Sharan Tej Kodumuru
You just click in the gutter of the script on the left -- Kreg Steppe

Where do I find the resource with the other epsiodes? -- Nathan Carlson
http://bit.ly/servicenow-technow -- Chuck Tomasi

Although it seems like you CAN debug REST APIs using the REST API Explorer (which it may be worth noting), is there a good way to debug typically asynchronous operations? -- Timothy Woodruff
For async (non-interactive) actions you're going to have to use tried-and-true log statements. -- Chuck Tomasi

Might be useful to mention... "gs.warn()" and "gs.logWarning()" behave differently. gs.warn() accepts up to 6 arguments, but 2-6 are all string-replace arguments. Meanwhile, gs.logWarning() accepts two arguments, and the second one is the "source". The source replaces the "source" field in the log. You cannot replace the source field in the log using "gs.warn()". The exact same applies for gs.error() vs. gs.logError(). -- Timothy Woodruff
Thanks for the info Timothy. We didn't have a chance to cover it on this episode as we were mainly focused on the debugger. -- Chuck Tomasi

udpate in wrong palce -- Lynne Mazey
Bingo! -- Kreg Steppe

Are there plans on making this OOB so we don't have to ignore updates on upgrades? -- Ilo Gassoway
I'm sorry. I don't know specifically to what you are referring when you say "Are there plans of making this..." What is "this"? -- Chuck Tomasi

Is this only for scoped applications? (I am sorry if I missed this earlier in this techNow session) -- Ritesh Shah
This will work on global and scoped applications as long as the code is run server-side as the current, interactive user. -- Stacey Bailey

Sorry, so if the BR calls a script_include, when you step into that objects method, does that file auto load into the Script Debugger? -- Javier Lopez
Yes. You can step in to any script include you can see. -- Chuck Tomasi

Can you use the debugger and impersonnating a user at the same time? -- Paul-Eric Paumard
Yes -- Chuck Tomasi

When do tickets go on sale for Knowledge 19? -- Christina Muniz
Typically around the first of the year. Keep watching the knowledge.servicenow.com website for information -- Chuck Tomasi

If you guys at ServiceNow are recommending adding the Description field to the Business Rules view, why dont you guys just add it so everyone has it already? -- Steven Young
Not sure that everyone needs it, but you have a point. -- Kreg Steppe

Is there a debugger for client scripts? Thanks. -- Ed Leung
Yes. https://developer.servicenow.com/app.do#!/training/article/app_store_learnv2_scripting_istanbul_client_side_scripting/app_store_learnv2_scripting_istanbul_debugging_client_scripts?v=istanbul -- Kreg Steppe

I am using SNOW only 3 months... RE: look at the context of the WF, how? -- Munhwan Gim
This isn't really on topic, but since the answer is fairly simple - navigate to Workflow> Workflow Context. If you have additional questions about ServiceNow, please don't hesitate to post in the community. -- Chuck Tomasi

Do the Debugger work on Fix Scripts ? -- Stewe Lundin
No. Fix scripts do not run interactively. They are handled in the background by the system. -- Chuck Tomasi

Can you use "breakpoint;" or some other code/syntactic breakpoint, so you don't have to add your breakpoint in the actual editor? -- Timothy Woodruff
Currently breakpoints are set in the editor -- Chuck Tomasi

Can we see a simple demonstration of using these debug tools for something from the Global scope? On my instance I don't have the same options -- Ben Adams
Sorry I didn't have time for this in the demo we did. I just checked in Kingston and things look the same whether debugging global or scoped. If you like, post a message in the community and we can have a deeper discussion and let others get involved to see if there is some difference (e.g. ServiceNow version) that might be going on. -- Chuck Tomasi

Are the Break points personal ? -- Stewe Lundin
Yes -- Chuck Tomasi

Is there anywhere we can find information on moving an existing instance to a FedRamp instance? -- Jeff Thurston
I recommend reaching out to your account team. We have FedRAMP specialists who can help. -- Chuck Tomasi

What about an Orchestration Catalog item that calls a workflow with run scripts that call script includes? -- Mark Denni
If the script include was called from a workflow, then it's not interactive and the debugger won't be of much use. Things that run in the background are running in a separate context than the browser stuff. -- Chuck Tomasi

Hello, similar to the last question, a lot of filters for reference selection pop ups have script includes, would those be seen in debugger? -- Sanaz Shaghaghi
Should be good there. -- Chuck Tomasi

please talk about scheduled job debugging. -- Jeff Bascou
Schedule jobs run in the background so debugging them requires tried and true log statements. -- Chuck Tomasi

Thank you -- Jeff Thurston
You are welcome -- Kreg Steppe

In Istanbul, the debuger did not display all the variables in the "local" section, has this been fixed? Also, in the same section, objects are not properly displayed (can't display or drill down), has this been adressed? -- Eric Therrien
The demo we did was on Kingston. If you want to compare, you can always get a personal developer instance (for I, J, or K) https://developer.servicenow.com -- Chuck Tomasi

Nice! I just saw someone post a video of something doing that yesterday. -- Steve MacDonald
If you can, please post a link in the comments below so others can share. -- Chuck Tomasi

is this only limited to script include and business rule? -- ravish shetty
It will work on any script that runs server-side as the current, interactive user. This includes Business Rules, Script Includes, and UI Actions (that are not running client-side). -- Stacey Bailey

Is there any existing Javascript console/REPL that developers can use as part of ServiceNow (or is it something on the roadmap)? It would be super useful to be able to execute and evaluate arbitrary Javascript code using ServiceNow's APIs (e.g., GlideSystem) without having to save and execute a given script. -- Michael Anderson
Take a look at XPlore on the share portal from James Neal. It's a vast improvement over Scripts - Background. -- Chuck Tomasi

Chuck, does Stacey know where you live??? 😉 -- Paul-Eric Paumard
HA HA! I'm sure she can find out if she doesn't already. -- Chuck Tomasi

You already mentioned that the Script Debugger does not work to debug the Workflow Script... Then, gs logging is only way to debug for WF script? -- Munhwan Gim
Yes or you an look at the Context of the Workflow. -- Kreg Steppe

explore section in customer success center still has knowledge 2018 content -- David Brown
Thanks. We will be updating it soon. -- Chuck Tomasi

We can always use debugger in Service Portal to Debug -- Anubhav Kapoor
I wasn't able to get that working. I'd be interested to hear more about what you did. -- Chuck Tomasi

Hi all, -- Sharan Tej Kodumuru
Hello! -- Kreg Steppe

Can the Script Debugger be used for scripts in the Global application? -- John Basso
Yes. -- Kreg Steppe

Can you edit the script in the script debugger? -- Eric Riemer
Not at this time. Note the lack of icons to save, indent, etc. -- Chuck Tomasi

@Stacey - Gadget geek? Any Raspberry Pi's in your arsenal? 🙂 -- Steve MacDonald
I'm working on building an egg-decorating robot using an Arduino at the moment. 🙂 -- Stacey Bailey

Why does it always scroll to the bottom when editing a form design? -- Eric Riemer
It doesn't ALWAYS do it. Test with some other forms. I haven't figured out why/when it decides to do that. I suspect there is something that's causing it like a formatter. -- Chuck Tomasi

So on the other side - you can't then add a new breakpoint from there, right? -- Trez Moreland
Not sure of the context of this question, sorry. -- Chuck Tomasi

More a comment than a question, but wanted to make you all aware. A good deal of the time, when it has come to a customization and H, they will often come back and tell us to consult the community, rather than them being able to support the issue. That can get very frustrating. -- Carl Murray
I'm sorry you run in to this situation. It is part of the way our support is structured right now in that they train to support the out-of-box applications. Customizations are beyond our capability to support at this time. -- Chuck Tomasi

bianca_vaccarin
ServiceNow Employee

The transcript is helpful!

Chuck Tomasi
Tera Patron

Thanks. I've been looking at the formatting for better ways. Let me know what you think. Should I go with the format of this example instead?

Fred Luddy: Does the script debugger work on scriptless business rules?

Chuck Tomasi: There's no script - what would it debug?

 

Or do you like the "-- name" format I'm using? Or something else? I can use HTML so use your imagination.

 

Carl Fransen1
Kilo Sage

Hi Chuck - another great session and love the Q&A's added to this.  To follow up on your previous post on formatting can I add my 5c into the ring...

 

  • Love the bold questions
  • Names at the end of the questions are great, so it keeps other noise to the end of the line
  • Maybe add a prefix of 'Q' and 'A' to the lines so we can easily see the questions over the answers
  • You could change the font (or make italic??) the names at the end of the lines to these are slightly different looking
    • maybe a grey, or in a grey box..?

 

Hope this help - keep up the good work!

 

Also - with the ever growing user-base of ServiceNow - it would be awesome to see some Tech sessions LIVE in a 'down under' timezone such as New Zealand!!!!!!

 

Cheers

Carl.

rjp
Tera Expert

Chuck,

I loved this presentation got alot out of it, thanks for posting it!  Quick unrelated question, are you the same Chuck Tomasi that called into the Rock and Roll Geek recent episode and gave a show review of the Jason Bonham Led Zeppelin Experience?  If so, sounds like a great show thanks for the review, if not please disregard.

Stay frosty my friend.

-Rob