You can select 2 data elements and 2 districts. Pretty much, for every district selected a record should be inserted with that districtID and each of the data elementIDs. So, if 2 districts are selected and 3 data elements, there should be 6 rows. It should loop through the districts selected and all the data elements selected and add one record for each combination. The softwareID that also gets inserted is always the same value. Does this make sense?