Enum AuthMode  |  Apps Script  |  Google for Developers (2024)

Stay organized with collections Save and categorize content based on your preferences.

An enumeration that identifies which categories of authorized services Apps Script is able toexecute through a triggered function. These values are exposed in triggered functions as the authModeproperty of the event parameter, e. Formore information, see the guide to theauthorization lifecycle for add-ons.

To call an enum, you call its parent class, name, and property. For example, ScriptApp.AuthMode.CUSTOM_FUNCTION.

function onOpen(e) { var menu = SpreadsheetApp.getUi().createAddonMenu(); if (e && e.authMode == ScriptApp.AuthMode.NONE) { // Add a normal menu item (works in all authorization modes). menu.addItem('Start workflow', 'startWorkflow'); } else { // Add a menu item based on properties (doesn't work in AuthMode.NONE). var properties = PropertiesService.getDocumentProperties(); var workflowStarted = properties.getProperty('workflowStarted'); if (workflowStarted) { menu.addItem('Check workflow status', 'checkWorkflow'); } else { menu.addItem('Start workflow', 'startWorkflow'); } // Record analytics. UrlFetchApp.fetch('http://www.example.com/analytics?event=open'); } menu.addToUi();}

Properties

PropertyTypeDescription
NONEEnumA mode that does not allow access to any services that require authorization. This mode occurswhen an add-on executes an onOpen(e) simple trigger, and the user has installed anadd-on in a different document but the add-on has not been used in the current document.
CUSTOM_FUNCTIONEnumA mode that allows access to a limited subset of services for use in custom spreadsheetfunctions. Some of these services — including read-only access to Spreadsheet service —normally require authorization, but are permitted without authorization when used in a customfunction. Because custom functions do not include an event parameter, this value is neverreturned; it is documented only to demonstrate that custom functions run in their ownauthorization mode.
LIMITEDEnumA mode that allows access to a limited subset of services. This mode occurs when an add-on or ascript bound to a document executes an onOpen(e) or onEdit(e) simple trigger, except in the case described for NONE.
FULLEnumA mode that allows access to all services that require authorization. This mode occurs when anadd-on or a script executes as the result of any trigger other than the cases described forLIMITED or NONE.

Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2023-11-01 UTC.

Enum AuthMode  |  Apps Script  |  Google for Developers (2024)
Top Articles
How to Remove Write Protection on a USB Drive: 6 Easy Steps
Top tips on preparing for a mortgage appointment
Uvalde Topic
R Statistical Software
Little League Coach Daily Themed Crossword
Fantasy Football Week 3: 5 players who could make or break your lineups
Hexanaut.io: Trucs et Astuces pour Notre Nouveau Jeu IO
Free Inter Tv Live
Leonard Funeral Home Dubuque Iowa
Piezoni's North Attleboro
Planet Fitness $99 2023
Aes Salt Lake City Showdown
Choose the antonym of the given word- Rarely a) Hardly b) Frequentlyc) Definitelyd) Absolutely
Demystifying The 786 Area Code: History, Coverage, And The Future Of Miami's Telephone Lifeline
Qr 0738
XFN: Introduction and Examples
Okta Hendrick Login
Van der Poel kleurt EK op kasseien, maar Merlier wint sprint vlak voor Kooij
Bulls set the ‘gold standard’
90 Days From February 28
Gia Divine - Songs, Concert tickets & Videos
Minecraft Jar Google Drive
Macbeth Summary Activity: 5 Act Structure
Lake County Florida Trash Collection Schedule
Brazos County Mugshots Busted Newspaper
Insidekp.kp.org Myhr Portal
Tamilyogi Movies Download 2022 Free Download
Couponsky Net
Harbor Freight Tax Exemption
Metro 72 Hour Extension 2022
Implementation Project Manager III ($2K Sign-On Bonus)
Bandit Ui
Mexican Salad with Creamy Avocado Dressing: A Fresh and Flavorful Side Dish
Food Universe Near Me Circular
Citibank Branches In Georgia
Dresden Pool Hours
Batting Cages Towson
Loopnet Properties For Sale
Magicseaweed Encinitas
NRA Training
Wral Nighttime Lottery
Arknights Gamepress
Csulb Atlas
Soap Central Message Boards Bold And Beautiful
Morally Rigid Crossword Clue
St Edwards Bloomington Mn
Find Deals And Listings on Craigslist Houston Today
All JAGUAR XJ Models by Year (1979-2019) - Specs, Pictures & History
20Xx Training Pack
Busted Paper Haysi Regional Jail
Cta Bus Tracker 77
Latest Posts
Article information

Author: Allyn Kozey

Last Updated:

Views: 5419

Rating: 4.2 / 5 (43 voted)

Reviews: 90% of readers found this page helpful

Author information

Name: Allyn Kozey

Birthday: 1993-12-21

Address: Suite 454 40343 Larson Union, Port Melia, TX 16164

Phone: +2456904400762

Job: Investor Administrator

Hobby: Sketching, Puzzles, Pet, Mountaineering, Skydiving, Dowsing, Sports

Introduction: My name is Allyn Kozey, I am a outstanding, colorful, adventurous, encouraging, zealous, tender, helpful person who loves writing and wants to share my knowledge and understanding with you.