Connect two Google Sheets with script
<p>I want to create a sheet by <code>SpreadsheetApp.create();</code> and to fill a QUERY in this new generated sheet via <code>cell.setFormula</code> and IMPORTRANGE to get data of another Sheet.</p>

<p>It doesn't work because the sheets are not connected. If I do so manually the QUERY works.</p>

<p>Is there a way to connect two sheets via script?</p>