title: How get textinput value on gmail addon
body: <p>I create a Gmail add-on with a form.
  In this form, I have input but in my script, I can not find how to retrieve the value of input in variables.
  The following code opens a sidebar in the Gmail inbox when you click on an e-mail and fill in the form's input with the mail's metadata and contact information. If the contact does not exist, the user can create it by entering the name and first name of the sender (the e-mail address is retrieved from the e-mail).
  But I do not know how to recover the information entered by the user.</p>
  
  <p>Here is my script:</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>function buildAddOn(e) {
    // Activer les extensions complémentaires de Gmail
    var accessToken = e.messageMetadata.accessToken;
    GmailApp.setCurrentMessageAccessToken(accessToken);
    
    var messageId = e.messageMetadata.messageId;
    var message = GmailApp.getMessageById(messageId);
    var emailAddress = recupEmail(message.getFrom(), '&lt;', '&gt;'); // Dans le message, l'adresse mail de l'expéditeur se trouve entre les balises '&lt;' et '&gt;'
    var objet = message.getSubject();
  
    var contact = ContactsApp.getContact(emailAddress);
    var contactNom;
    var contactPrenom;
    
    if(contact != null){
      contactPrenom = contact.getFamilyName();
      contactNom = contact.getFullName().replace(contactPrenom, '');
    }else{
      contactNom = '';
      contactPrenom = '';
    }// if-else
    
    var head = 'Expediteur';
    var labelNom = 'Nom';
    var labelPrenom = 'Prenom';
    var labelEmail = 'Adresse e-mail';
    var labelObjet = 'Objet';
    var labelMessage = 'Message';
    
    var action = CardService.newAction().setFunctionName('creatContact');
    var section = CardService.newCardSection();
    section.setHeader(head);
    section.addWidget(CardService.newTextInput().setFieldName('nom').setTitle(labelNom).setValue(contactPrenom));
    section.addWidget(CardService.newTextInput().setFieldName('prenom').setTitle(labelPrenom).setValue(contactNom));
    if(contact == null){
      section.addWidget(CardService.newTextButton().setText('Ajouter au contacts').setOnClickAction(action));
    }
    section.addWidget(CardService.newTextInput().setFieldName('mail').setTitle(labelEmail).setValue(emailAddress));
    section.addWidget(CardService.newTextInput().setFieldName('objet').setTitle(labelObjet).setValue(objet));
  
    var card = CardService.newCardBuilder()
    .addSection(section)
    .build();
    
    return [card];
  }
  
  function recupEmail(from, debut, fin){
    var result = from.split(debut)[1].split(fin)[0];
    return result;
  }
  
  function creatContact(){
    /*
    var givenName = ??;
    var familyName = ??;
    var email = ??;
    */
    ContactsApp.createContact(givenName, familyName, email)
  }</code></pre>
  </div>
  </div>
  </p>
  
  <p>Thank you in advance.
  Sorry for my bad english.</p>