Choose the entry point that matches the job
For an interactive result, open the spreadsheet and choose Checks → Count Data rows. This menu path uses the UI of the spreadsheet containing the bound script. A time-driven execution has no current spreadsheet UI for an alert. Set that trigger to checkFromSchedule, which calls the same worker and records its result without a dialog.
If the job is only an occasional check, keep the menu action and skip the trigger. Use a scheduled entry point when the check must run without someone opening the spreadsheet. Additional OAuth scopes do not create an interactive UI context.