when i save that, in mysql should be created 2 records one for first option, one for the second, and both have the same product_id, how is that possible? should be like this in mysql
You need to use a bulk insert query and pass it an array of records to insert. There are a few ways to make this array, but a Javascript transformer might be the most straigtforward.
This is probably pretty close to what you need.
// trMakeBulkInsertArray
lat newData = [];
let items = {[myMultiselect.selectedItems}}
let product_id = 1
items.forEach(item => {
newData.push({
product_id: product_id,
location_id: item.location_id
})
});
return newData
Then in your bulk insert query use {{trMakeBulkInsertArray.value}} in the Array of records to insert property