I get a small table into my sheet as query() result from huge database and can use these values in other formulas, copy them, etc. But I can't do the same thing using google apps script because it just can't read these values into my variables. I get #N/A or empty cells. My query function:
=query(IMPORTRANGE("[database link]";"'Database'!A3:AG1000000");"select Col23, Col24, Col25, Col26, Col28, Col29 WHERE Col22 contains '"&$C$3&"' ")
To check cells values I used this code:
var active_spread_sheet = SpreadsheetApp.getActiveSpreadsheet();
var active = active_spread_sheet.getSheetByName('Query result').getActiveCell().getValue();
Browser.msgBox(active);
Interesting thing: when I tried to copy first query() result using another query() function - after around a minute of loading I get the same result like my script reads cells values in first function. #N/A and empty spaces in the appropriate places.