Dropdown List

I have a dropdown list where i have pushed an additional item onto the list through the below code. The item i have pushed onto the list appears at the bottom of the dropdown list.

I want “All Items” to appear at the top of the dropdown list. Does anyone know how to make it appear at the top of the list instead of at the bottom of the dropdown list ?

let opts = $w(“#dropdown1”).options;
opts.push({ label: “All Items”, value: “All Items” });
$w(“#dropdown1”).options = opts;

Hello

Try using unshift function:

let opts = $w("#dropdown1").options;
opts.unshift({ label: "All Items", value: "All Items" });
$w("#dropdown1").options = opts

Best
Massa

Thank you Massa that solved it