'Flask save form data from different pages

I have two HTML webpage with two forms, both of them linked to result page ("out"). I want to get a integrated out dataframe with customer who choose Revenue in first page and Item in second page. But it seems my flask got executed everytime returning only one page. Is there any method I can save both of forms in different pages into "out" except for making all of them in one page?

@app.route("/out/<name>", methods = ['GET','POST'])
def out(name):
    # Data preprocessing
    f1=pd.read_csv("Fruit info.csv",engine="python")
    out=pd.DataFrame()

        
    selects1 = request.form.getlist("subselect1")
        
    if "Revenue" is in str(selects2):
        out["Fruit price"]=f1["Orange"].str.isdigit()
        
    selects2 = request.form.getlist("subselect2")
    if "Items" is in str(selects1):
        out["Fruit price"]=f1["Orange"].mean()
    return render_template('out'+name+".html",name=name,tables=[out.head().to_html(classes='data')], titles=["1","2","3","4"])


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source