Class Navigation

Navigation

A helper object that controls card navigation. See the card navigation guide for more details.

Sample usage:

 function 
  
 myFunction 
 () 
  
 { 
  
 return 
  
 AddOnsResponseService 
 . 
 newChatDataActionBuilder 
 (); 
 } 

Methods

Method Return type Brief description
Navigation
Navigation
Navigation
String Prints the JSON representation of this object.
Navigation Pushes the given card onto the stack.
Navigation Sets the end navigation action.
Navigation Does an in-place replacement of the current card.

Detailed documentation

pop Card()

Available for Google Workspace add-ons that extend Google Chat.

Pops a card from the navigation stack. Can be chained with other card navigation actions.

Return

Navigation — This object, for chaining.


pop To Named Card(cardName)

Available for Google Workspace add-ons that extend Google Chat.

Pops to the specified card by its card name. Can be chained with other card navigation actions.

Parameters

Name Type Description
card Name
String The name of the card to navigate to.

Return

Navigation — This object, for chaining.


pop To Root()

Available for Google Workspace add-ons that extend Google Chat.

Pops the card stack to the root card. Can be chained with other card navigation actions.

Return

Navigation — This object, for chaining.


print Json()

Prints the JSON representation of this object. This is for debugging only.

Return

String


push Card(card)

Pushes the given card onto the stack. Can be chained with other card navigation actions.

 const 
  
 card 
  
 = 
  
 CardService 
 . 
 newCardBuilder 
 () 
  
 . 
 setHeader 
 ( 
 CardService 
 . 
 newCardHeader 
 (). 
 setTitle 
 ( 
 'Card title' 
 )) 
  
 . 
 addSection 
 ( 
 cardSection 
 ) 
  
 . 
 build 
 (); 
 const 
  
 navigation 
  
 = 
  
 AddOnsResponseService 
 . 
 newNavigation 
 () 
  
 . 
 pushCard 
 ( 
 card 
 ); 

Parameters

Name Type Description
card
Card A card to add to the stack.

Return

Navigation — This object, for chaining.


set End Navigation(endNavigation)

Sets the end navigation action.

 const 
  
 navigation 
  
 = 
  
 AddOnsResponseService 
 . 
 newNavigation 
 () 
  
 . 
 setEndNavigation 
 ( 
 AddOnsResponseService 
 . 
 EndNavigation 
 . 
 CLOSE_DIALOG 
 ); 

Parameters

Name Type Description
end Navigation
End Navigation The End Navigation to use.

Return

Navigation — This object, for chaining.


update Card(card)

Does an in-place replacement of the current card. Can be chained with other card navigation actions.

 const 
  
 card 
  
 = 
  
 CardService 
 . 
 newCardBuilder 
 () 
  
 . 
 setHeader 
 ( 
 CardService 
 . 
 newCardHeader 
 (). 
 setTitle 
 ( 
 'Card title' 
 )) 
  
 . 
 addSection 
 ( 
 cardSection 
 ) 
  
 . 
 build 
 (); 
 const 
  
 navigation 
  
 = 
  
 AddOnsResponseService 
 . 
 newNavigation 
 () 
  
 . 
 updateCard 
 ( 
 card 
 ); 

Parameters

Name Type Description
card
Card A card to replace the current card with.

Return

Navigation — This object, for chaining.

Create a Mobile Website
View Site in Mobile | Classic
Share by: