title: pass return argument value one function to another flask
body: <p>I would like to return a value from one function to another function and use it to filter my excel.
  Below is what am trying to do:</p>
  
  <pre><code>@app.route('/bzrules')
  def show_tables():
      rules = pd.read_excel('static/dummy_data.xlsx')
      # User will select value in drop down in view.html. I want the user selection to be passsed to my second function below to filter my excel sheet
      subarealist = rules['Subject_Area'].unique().tolist()
      return render_template('view.html', subarealist=subarealist)
  
  @app.route('/postfields')
  def postfields():
      # this is were user selection from first function to pass and help select sheet from my excel
      dt = pd.read_excel('static/AllDataSheets.xlsx', sheetname='User selection from subarealist')
  </code></pre>
  
  <p>below is part of View.html code :</p>
  
  <pre><code>&lt;form action="{{ url_for('show_tables') }}" method="POST"&gt;
       &lt;div class="form-group"&gt;
        &lt;div class="input-group"&gt;
              &lt;select name='fieldnames'onchange="this.form.submit()"&gt;
                  {% for val in subarealist %}
                    &lt;option value='{{val}}' selected="search_key" {% if search_key==val %}{% endif%}&gt;{{val}}&lt;/option&gt;
                    &lt;option selected="selected"&gt;&lt;/option&gt;
                  {% endfor %}       
             
  </code></pre>