Servicenow Scripted rest API debugger | ServiceNow debugger rest API | ServiceNow debugger Tips

preview_player
Показать описание
Hi Friends,

Hope you are doing fine. In this video, we will see the rest API debugger. How we can debug the rest API in the ServiceNow environment.

Debugging in ServiceNow is an essential skill to master. An array of tools are available to help developers understand what the system is doing and narrow down where unexpected behavior is happening. Today we will look specifically at several ways to debug when doing scripting.

SESSION DEBUG
A feature released in the New York release unified the session debugging modules. A session is a unique login for a unique user - typically one browser on one device. Now when selecting a session debugging option from the navigation, a new window launches.

The session log and debugging options are available in this interface. On the left, you have the transaction list available. Selecting one of the transactions will jump you to the start of that transaction in the log entries. The search filter does what you would expect, filter the log entries to just lines that contain the search term. The filters in the dropdowns can be handy when many things are happening at once.

It can be confusing to see a filter for debugging options like business rules and also a setting for business rules. The filter narrows the displayed log, where the settings toggle debugging options on/off. Only log entries for the debugging types that are enabled will be visible and then filterable. Most debugging will not need all debugging types turned on, as that will produce to much noise that must be filtered to find the information you as the developer are looking to find.

Breakpoints and Conditional Breakpoints are where we insert a pause in the execution flow. That pausing leads to an essential note: breakpoints only apply in direct synchronous sessions. Only the developer that set the breakpoint, and only in their session in which a script debugger window is opened, will be paused. Thus you can safely debug without impacting your fellow developers. You can read more about the details of the script debugger in the detailed blog entry.

Leveraging the script breakpoints can be a powerful tool to reduce the need for log entries to validate field and object values. Using the inspector, you can see the value for all of the variables as you step through your script and other scripts called later in the execution flow. Figuring out how and why your result didn’t reach the outcome you inspected can be quickly determined with this method.

A Tip is invoking an asynchronous process directly through background scripts or the rest API explorer.

When should you use the session debugging? session debugging has a variety of options from ACL to Business Rules to Upgrade. What kind of information you are seeking will lead you to one or several of the debugging options. If you wish to know why your new script isn’t adjusting a field as you expect, then the business rule would be my first visit unless you can utilize a breakpoint. (we will talk more about breakpoints later). Access can be easily checked by using the security debugging along with impersonation.

The joining of all the logs into one powerful interface should help you find the root cause of whatever you are inspecting. Utilize the clear log tool between tries to help lessen the noise when applicable. Knowing how to best filter, find, and examine the results will enable you to develop faster and hopefully with fewer errors. One way to do that is to try out the debugging before you encounter an issue. Give it a try on an update of a record you are familiar with before adjusting any business logic. That way, you have some idea of what things look like before you changed anything.

Hope you like this video. Please follow subscribe to get the latest update on the ServiceNow Videos.

Regards,
Amit Gujarathi
(Technomonk Team)
Рекомендации по теме
Комментарии
Автор

This is very informative video however the background music is very dominating.

sameerthakare
Автор

How could we listen to it when the background sound is so strong.

kavushikababurajendran
Автор

You speak english but we cant understand you please use a good mic,

ysonrecudo
join shbcf.ru