title: Dynamic bigquery query in dataflow template
body: <p>I've written a Dataflow job that works great when I run it manually. Here is the relevant section (with some validation code removed for clarity):</p>
  
  <pre><code>parser.add_argument('--end_datetime',
                      dest='end_datetime')
  known_args, pipeline_args = parser.parse_known_args(argv)
  
  query = &lt;redacted SQL String with a placeholder for a date&gt;
  query = query.replace('#ENDDATETIME#', known_args.end_datetime)
  
  with beam.Pipeline(options=pipeline_options) as p:
      rows = p | 'read query' &gt;&gt; beam.io.Read(beam.io.BigQuerySource(query=query, use_standard_sql=True))
  </code></pre>
  
  <p>Now I want to create a template and schedule it to run on a regular basis with a dynamic ENDDATETIME. As I understand it, in order to do this I need to change add_argument to add_value_provider_argument per this documentation:</p>
  
  <p><a href="https://cloud.google.com/dataflow/docs/templates/creating-templates" rel="noreferrer">https://cloud.google.com/dataflow/docs/templates/creating-templates</a></p>
  
  <p>Unfortunately, it appears that ValueProvider values are not available when I need them, they're only available inside the pipeline itself. (please correct me if I'm wrong here...). So I'm kind of stuck. </p>
  
  <p>Does anyone have any pointers on how I could get a dynamic date into my query in a Dataflow template? </p>