Hi All,
I am creating a new app to insert student records, from my main app page(Create.py) I insert records in to database. Using multipage concept I have created Search.py and Delete.py under /pages/ folder to search and delete records.
Upon clicking “Insert” in Create.py I intend to display the new records inserted in to database in a new page.
To achieve this I created a new View_Record.py in the same folder as Create.py and tried to do st.switch_page(“View_Record.py”) which gives me below error:
streamlit.errors.StreamlitAPIException: Could not find page:
C:\Users\SK\Desktop\python\View_Record.py
. Must be the file path relative to the main script, from the directory: python
. Only the main app file and files in the pages/
directory are supported.
To encounter this I placed the View_Record.py under /pages , this absolutely works fine to switch page but the “View Record” also gets listed in the side bar which I dont want.
I also tried hide this page using st_pages but unfortunately streamlit cannot switch to a page which is hidden.
Any pointers on how to achieve this? How would I launch a new page to display the record I inserted into DB by clicking “insert” button.