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

277
Vistas
how to get new response from a google form to different folders based on the form input value

I have a form contains questions

  1. BL number
  2. Importer code
  3. Upload file when each user submit response, files should be saved in different folders and folder name should be input value of question "BL number". how we can make it possible ?
about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

It heavily depends on how your form looks like.

Here is an example how it could be done.

Suppose you have a very simply form like this:

enter image description here

It has two 'namedValues': Folder and File, they will be used in the script below.

Next step: You have to add a 'linked' spreadsheet to the form.

enter image description here

In this spreadsheet you have to add this script:

// names and IDs of your destination folders

var folders = {
  'aaa' : '###', // <-- you have to change ### with a real ID
  'bbb' : '###',
  'ccc' : '###'
}

function move_file_to_folder(e) {

  // get folder ID from folders object
  var folder_id = folders[e.namedValues['Folder'][0]]; // <-- the name from the named value 'Folder'

  // get file ID from the form
  var file_id = e.namedValues['File'][0].split('id=')[1]; // <-- the url from the named value 'File'

  // move the file into the folder
  DriveApp.getFileById(file_id).moveTo(DriveApp.getFolderById(folder_id));
}


// this function should be run just once to install the trigger

function install_OnFormSubmitTrigger() {
  var ss = SpreadsheetApp.getActive();
  ScriptApp.newTrigger('move_file_to_folder')
      .forSpreadsheet(ss)
      .onFormSubmit()
      .create();
}

After that you have to run the function install_OnFormSubmitTrigger() to install the trigger.

Probably it makes sense to run the function move_file_to_folder() as well, in order to get the propper access. It will get you an error. Don't mind. Keep calm and carry on.

Now, every time you submit the form the uploaded file will go into a folder with respective name ('aaa', 'bbb', 'ccc' in my example).

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