Defines what happens when a card button is clicked.
class CardService method .newAction()
CardService is the Apps Script service.
.newAction() is the method name you will see after a dot in your code.
What it does
Why it's used
- Wire a button to a server function when clicked.
- Handle mark done or create row from the add-on.
Common errors
- Forgetting parentheses on newAction. Write CardService.newAction(), not CardService.newAction or newAction by itself.
- Skipping dots between chained calls. Each step needs a dot, like CardService.newAction().
- Adding spaces where they do not belong. Write CardService.newAction(), not CardService .newAction(), CardService.newAction (), or CardService . newAction().
- Wrong capitalization. Use CardService and newAction, not cardservice or newaction.
Explore
Related methods
-
.newTextButton()
Creates a clickable text button for a card.
-
.newNavigation()
Defines navigation between cards in an add-on.
-
.newCardBuilder()
Starts building a card UI for a Workspace add-on.
-
.newTextParagraph()
Creates a block of text for a card.
More Apps Script
Better Sheets tutorials
No tagged tutorials yet. Fetch Apps Script from the harvest table and this page fills automatically.