title: Wait to load google sheets data before running script
body: <p>I have multiple users who submit daily progress information via a Google form at different work sites.</p>
  
  <p>All the data gets dumped into a single sheet -> Call it the master sheet</p>
  
  <p>I have created separate sheets that use the <code>query</code> function to filter data pertinent to each site -> call it the single site sheets</p>
  
  <p>Each month, I have a google apps script that creates a pdf summary by month for responses at each site. This has been working fine for some time, but recently, the script runs and creates a pdf without any data.</p>
  
  <p>When I have tried to troubleshoot this I think I see the issue. Now that the master sheet has collected over 1000 rows of data, the query function for each single site sheet takes a few seconds to load. During the load time, the script runs without any data in the single site.</p>
  
  <p>Is there a way to ensure the relevant data has completely loaded before the app script runs on that sheet? Maybe with a setTimeout or some on.load function?</p>