store html checkbox value into list using flask, jinja2

I’m in need of some help. I am using flask and I have had an HTML page with a bunch of checkboxes. They are ordered as option1, option2, and option3 and then under the options, there are a number of boxes to check. I am trying to keep track of what all boxes have been checked for which option and store that information into a list. currently my logic is to use some for loop within the HTML file using Jinja2 and try to set some unique name tag in the form such as name=”{{getboxitem}}” However my logic is only