Confused about how value is stored

I have an insert below that all works fine except the item_sort field. The user is setting the value using a drop down menu. The choices are 1 through 20 with both the labels and values being the same. Everything looks to save properly. When I go to the page that displays everything the new entry does not show up. I discovered that If type the number directly into the table everything works fine so apparently the value of the dropdown menu isnt being saved properly even though it looks like it is. Any thoughts?

export function confirm_click(event) {
const item = $w( ‘#tutorialsTop’ ).getCurrentItem();
const _owner = userId;
const tutorials_top_id = item._id
const item_sort = $w( “#sortDrop” ).value
const item_type = “Both”
const item_vtitle = “THIS IS THE DEFAULT TEXT”
wixData.insert( ‘tutorials_sub1’ , { _owner, tutorials_top_id, item_sort, item_type,item_vtitle })
var top_id = item._id;
$w( “#tutorialsTop” ).setFilter(wixData.filter().eq( ‘_id’ , top_id))
}

there’s gotta be way to do this.

Still trying to figure this out if anyone has any ideas.

Are you sure you have a value in this line:

const item_sort = $w("#sortDrop").value

Add this to find out:

console.log($w("#sortDrop").value);

Yep, if you look at my picture you can see the number there. Log shows the number as well.

I wonder if this is more of a problem with wix. Maybe I should contact support.

This was strange. I changed the field type to text and everything works now.