variable watch while debugging

537 views
Skip to first unread message

Todd Wolford

unread,
Sep 15, 2023, 10:03:34 PM9/15/23
to Google Apps Script Community
Is it possible to do a variable watch in a google script while it's debugging? (break when variable changes, or hits a certain value)

cwl...@gmail.com

unread,
Sep 17, 2023, 6:10:26 AM9/17/23
to Google Apps Script Community
Yes. In the editor, you can add breaks by clicking next to the line where you want it to break. Then you can watch the variables in the right panel. If you put a break inside an iterator (loop), it should break during each iteration, nd you should be able to see the variable value changing. The line where you add the break will not have executed yet. So in this example, "range" is still not defined yet.

debug.png
Reply all
Reply to author
Forward
0 new messages