Functions that worked and IMPORTRANGE

I have a Google Apps script that compares information provided in a Google form with information that is entered into a Google spreadsheet using the IMPORTRANGE function. The script works fine if I run it manually, but if it is run from the form submit trigger, it reports that it is not getting the correct information from the cells using IMPORTRANGE.

Is there a way around this, for example, is there a quick function that I can add that causes the import range to be updated?

I already tried to add a wait time of up to 10 minutes, and this did not change the results.

+3
source share
1 answer

, , importRange. , /, , , ( , , , , ). ​​

- (, , ) . script , .

script importRange. , .

var values = SpreadsheetApp.openById('external-spreadsheet-key').
  getSheetByName('Sheet1').getRange('A1:D100').getValues();
SpreadsheetApp.getActive().getSheetByName('DestSheet').
  getRange(1,1,values.length,values[0].length).setValues(values);

, , .

+9

All Articles