Dhruv Gupta1
Kilo Sage
Kilo Sage

So, today we will be discussing one of the latest feature called Script Tracer. But Before moving to that I want to ask you something. So, how many of you like crime suspense thrillers like Sherlock Holmes where you don’t know who the culprit is and till the very end whole fight or struggle is around finding out the culprit. I do love that kind of series or movies. One thing if you might have noticed that while doing an investigation most important step is to gather all the facts like what happened in that duration, what triggered what, who are the suspects, what was the motive behind the crime etc.  We usually try to inspect the crime scene in an isolation to restrict our imagination and stay on facts.

Now if you agree with me let’s move on to Servicenow and analyze the crime scene.

 find_real_file.png

Indeed!! So, as my daily job on Servicenow, I frequently face the challenge of exploring the script that might have triggered some action. Which BR or which Script Include or which flow script is making this form behave like this. Things become more complicated when the actions are triggered by Different tables. Yes, it’s a pain.

So, recently I was in a sync call with @Andrew Barnes - AJB  and he presented the script tracer and I was like:

find_real_file.png

So, as an intro, you can call it an informer or a very skilled officer who captures every detail of the crime scene. So, let’s look at its definition:

The Script Tracer can help you filter your debugging search to quickly narrow down script problems. You can identify lines of scripts in the Glide record that have undergone change during execution. Finding those specific lines of scripts rather than doing a wide search helps save time and improves productivity.

Use the Script Tracer to narrow your search so you can debug scripts and business rules more efficiently. You can find the Script Tracer by searching in the left navigation pane.

find_real_file.png

It’s a session-based thing similar to a script debugger. Click on start Tracer.

find_real_file.png

 

So in the below video, I have just shown a scenario where I can see what all happened when I do some modifications on the change form. It shows me the list of tables involved in all the BR’s, ACL scripts everything that runs in that specific session or duration. How easy it becomes to search and do the fixation. It is easy right.

 

 

 

Usually, we call it gut or experience that boss it has to be a business rule who is creating a mess around so you can just filter on BR’s and see them. I mean it's amazing and so developer-friendly.

So now, I will just copy-paste the content from the Docs page to define all the options that you see over there.

 

To view trace details, click a row in the table. The StateScript, and Transactions tabs are displayed for the selected row.

find_real_file.png

State

The State tab displays the fields and new values resulting from the row selected in the table. To see all of the record's fields and values, deselect (uncheck) the Show only changed values option. Changed values are highlighted in green.

 find_real_file.png

  • Script: Displays the line of changed scripts that the Glide record has undergone during execution. You can view the entire line of the script by clicking the Show Script
  • Transaction: Shows all transaction records of the trace
  • Debug Script: Opens the script in Debugger to debug the script
  • View File: Opens the script in the ServiceNow platform for editing
  • Clear trace: Clears the trace when you are finished.

 

If you find the article helpful, please mark the article as helpful, and do remember to bookmark this article.

In case you need any help, please do connect with me. It will be my pleasure to help you.

 

 Happy Learning Guys!!!

----->Dhruv Gupta

Version history
Last update:
‎01-28-2021 03:15 AM
Updated by: