Menu using form data from window

I was hoping to get some help with menus. I’d like to keep most of the functionality of my app inside the menu structure. When I have a window open that has form fields, I’d like to be able to click on a menu item and have it read the data in the form and do what needs to be done. Currently my project is working fine if the user clicks on a button that is on the actual form, but I’d like to remove that button and have the user navigate to the menu to perform the action.

I tried to move the code from my form into the main page but the main page does not seem to be able to see the document. I’m not exactly sure how to handle this task. I’m also brand new to Electron so if posting my code here would be helpful I’d be happy to.