Wix code SDK error: The label parameter of item at index 0 that is passed to the options method cannot be set to the value 2

HI

can someone help me get rid of this error please im stuck. i have exact same code running above it for another drop down which is a text return and it works fine so i assume its a number vs string issue somewhere?

Wix code SDK error: The label parameter of item at index 0 that is passed to the options method cannot be set to the value 2. It must be of type string.

Front end code is like this

$w.onReady( async function () {
// This function calls the back end unique drop down creator
$w(“#food1Dropdown”).options = await populateDropdownfoodnamevalues(“MyFoods”,“foodType”);
$w(“#qty1Dropdown”).options = await populateDropdownquantitys(“Quantity”,“quantity”);

});

//Backend module as follows:

import wixData from ‘wix-data’;

export function populateDropdownquantitys(collectionName,valueField) {
let allItems = ;
return wixData.query(collectionName)
.ascending(“quantity”)
.find()
.then((results) => {
if (results.totalCount > 0) {
let items = results.items;
items.forEach((item) => {
let oneItem = {
label: item.quantity,
value: item[valueField].value
}
allItems.push(oneItem);
})
return allItems;
}
return null ;

}) 

}

It seems that the function is expecting a String but getting a Numerical Value instead. Try wrapping it like this:

let oneItem = { 
    label: String(item.quantity),
    value: String(item.value)
    };

Awesome cheers mate ! it works however when i select a quantity it always puts 1 in no matter what number i select? when its like this ,

let oneItem = {
label: String(item.quantity),
value: String(item[valueField])
}

if i take out [valueField] and replace with the actual value then it works fine and i can select its ok just give me less flexibility from backend code

let oneItem = {
label: String(item.quantity),
value: String(item.quantity)
}

how come the other way works with text? because text is already a string?