When we run the Google Apps Script First time it needs the Authorization of Google Apps Script to click on the “run” triangle icon and ensure the function to run. You can also check this official post
Check Video: Authorization of Google Apps Script
One of the Apps Script features developers appreciate is that you don’t have to write authorization code, which grants the program access to the user’s data. Although Apps Script manages this, users (of your app) still need to grant permission (for this script) to access their spreadsheets and be able to access other apps on your behalf.