A Watch is a debugging feature that can be used in the Task Builder for examining the state of variables and conditions within a running task. You can set a watch on a variable used in the task, or you can enter an expression to create a more complex watch. When a task is run, Watches are re-evaluated after each step is executed.
A watch can be the name of a variable. For example, to watch the value of a variable named TotalCount, add a watch that contains TotalCount.
Embedded expressions can also be used within a watch, using the same syntax as a standard embedded expression. For example, to watch the length of a variable called " myName", add a watch Len(myName)
The Watches Tool of the Debug pane displays a list of all watches and updates the value of each watch as the task runs. Watches can be added, removed, or modified using the Watches Tool.
To watch a variable:
Enter the variable to watch in one of the following ways:
In the Steps pane of the Task Builder, right-click the Create Variable step associated to the variable you want to watch and select Add to watchlist.
- or -
Type the name of the variable in the provided entry box and click Watch to add to the watchlist.
The variable and its current value (if applicable) is added to the Watches debug pane.
To watch an expression:
In the Watches debug pane, enter the expression to watch in one of the following ways:
Type the expression into the entry box. For example, to evaluate the length of a variable named myName, enter Len(myName).
- or -
Click Gear to the right of the Watches entry box. Then use the Expression Builder to create an expression to watch. Click Insert when you are finished.
Click Watch to add to the watchlist.
The variable and its current value (if applicable) is added to the Watches debug pane.
To modify a watch:
In the Watches Debug pane, right-click the watch and select Change.
Type the new variable or expression for the watch and press Enter.
To remove a watch:
Select the watch to be removed and press Delete, or right-click, then click Remove.
To remove all watches, right-click, then click Remove All.
NOTE: Using watches can affect runtime performance in the debugger on slower machines. If debugging speed becomes a factor, try removing watches that are no longer needed. This does not apply to runtime performance outside the debugger, as watches are ignored outside Task Builder.