Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

163
Vistas
Get HTML input into Google sheet in a specific format

The code snippet below is part of a larger script that collects user input from an HTML file and store these user input into my Google sheet. The type of input fields from the line formObject.firmenp all the way to the line formObject.zielplanung in my HTML file is date and have each their own specific ID. I want to get these dates in format day/month/year into my sheet.

Any idea or recommendation how to achieve that?

Thank you so much in advance for your help :).

function getFormValues(formObject){
  if(formObject.RecId && checkID(formObject.RecId)){
    var values = [[formObject.RecId.toString(),
    formObject.name,
    formObject.unternehmen,
    formObject.rufnummer,
    formObject.email,
    formObject.firmenp,
    formObject.onboarding,
    formObject.selbsttraining,
    formObject.crmm,
    formObject.tblock1,
    formObject.fdtblock,
    formObject.wochentraining,
    formObject.zielplanung,
    formObject.changestatus]];
  }else{
    var values = [[new Date().getTime().toString(),
    formObject.name,
    formObject.unternehmen,
    formObject.rufnummer,
    formObject.email,
    formObject.firmenp,
    formObject.onboarding,
    formObject.selbsttraining,
    formObject.crmm,
    formObject.tblock1,
    formObject.fdtblock,
    formObject.wochentraining,
    formObject.zielplanung,
    formObject.changestatus]];
  }
  return values;
}
about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

You can make a function like the below and convert all your data using it. Use this function on your script page.

//2021-11-05


var getDate = document.getElementById("date").value;
console.log("Inputted data: " + getDate);

function getNewDateFormat(value){
  var dateValue = new Date(value);
  var monthPart = dateValue.getMonth() + 1;
  var dayPart = dateValue.getDate();
  var yearPart = dateValue.getFullYear();
  
  var newFormat = dayPart + "/" + monthPart + "/" + yearPart;
  
  return newFormat
}

console.log("Expected data: " + getNewDateFormat(getDate));
//dummy input 
<input type="text" id="date" value="2021-11-05" />

about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda