Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

283
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda