I want to create a sheet by SpreadsheetApp.create(); and to fill a QUERY in this new generated sheet via cell.setFormula and IMPORTRANGE to get data of another Sheet.
It doesn't work because the sheets are not connected. If I do so manually the QUERY works.
Is there a way to connect two sheets via script?