class CardService method .newTextButton()

CardService is the Apps Script service.

.newTextButton() is the method name you will see after a dot in your code.

What it does

Creates a clickable text button for a card.

Why it's used

  • Add a clickable action on an add-on card.
  • Let users approve, snooze, or open a sheet from Gmail.

Common errors

  • Forgetting parentheses on newTextButton. Write CardService.newTextButton(), not CardService.newTextButton or newTextButton by itself.
  • Skipping dots between chained calls. Each step needs a dot, like CardService.newTextButton().
  • Adding spaces where they do not belong. Write CardService.newTextButton(), not CardService .newTextButton(), CardService.newTextButton (), or CardService . newTextButton().
  • Wrong capitalization. Use CardService and newTextButton, not cardservice or newtextbutton.

Explore

Related methods

Better Sheets tutorials

No tagged tutorials yet. Fetch Apps Script from the harvest table and this page fills automatically.