Pass values from stateless form into function

Pass values from stateless form into function

I have a function w/ a list of dates and a list of strings that populates a bunch of data in form1 - it works when executed.
I want to use statelessForm inputs dateField and dropDown to populate dateList and genreList in the below function and run it.
First, Is there a way to have a multi-select date field? Either way, this is what I have in the function now. How do I code the statelessForm submit button to pass the values, and how do I modify the below function to accept the statelessForm values? TIA!
  1. void getGenreSales()
  2. {
  3.   dateList = {"Aug 06 2023","Sep 07 2023"};
  4. for each  saleDate in dateList
  5. {
  6. genreList = {"Garage","Doo-Wop","Rockabilly"};
  7. for each  genre in genreList
  8. {
  9. \\populate a bunch of data...