Class OptionBuilder

Option Builder

A builder for creating options for Select Single s and Select Multiple s.

 const 
  
 cc 
  
 = 
  
 DataStudioApp 
 . 
 createCommunityConnector 
 (); 
 const 
  
 config 
  
 = 
  
 cc 
 . 
 getConfig 
 (); 
 const 
  
 option1 
  
 = 
  
 config 
 . 
 newOptionBuilder 
 (). 
 setLabel 
 ( 
 'option label' 
 ). 
 setValue 
 ( 
 'option_value' 
 ); 
 const 
  
 option2 
  
 = 
  
 config 
 . 
 newOptionBuilder 
 () 
  
 . 
 setLabel 
 ( 
 'second option label' 
 ) 
  
 . 
 setValue 
 ( 
 'option_value_2' 
 ); 
 const 
  
 info1 
  
 = 
  
 config 
 . 
 newSelectSingle 
 () 
  
 . 
 setId 
 ( 
 'api_endpoint' 
 ) 
  
 . 
 setName 
 ( 
 'Data Type' 
 ) 
  
 . 
 setHelpText 
 ( 
 'Select the data type you\'re interested in.' 
 ) 
  
 . 
 addOption 
 ( 
 option1 
 ) 
  
 . 
 addOption 
 ( 
 option2 
 ); 

Methods

Method Return type Brief description
Option Builder Sets the label of this option builder.
Option Builder Sets the value of this option builder.

Detailed documentation

set Label(label)

Sets the label of this option builder. Labels are the text that the user sees when selecting one or more options from the dropdown.

Parameters

Name Type Description
label
String The label to set.

Return

Option Builder — This builder, for chaining.


set Value(value)

Sets the value of this option builder. Values are what is passed to the code when a user selects one or more options from the dropdown.

Parameters

Name Type Description
value
String The value to set.

Return

Option Builder — This builder, for chaining.

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