I would make a small function like this. I think there are fancier ways to find a property but I find just looping to be the easiest and simplest to read
function findIndex ( dropDown , searchTerm ){
for ( let i = 0 ; i < dropDown . options . length ; i ++){
if ( dropDown . options [i]. value == searchTerm ){
return i
}
}
return - 1
}
and call it like this
let foundIndex = findIndex ( $w ( ‘#dropdown1’ ), ‘Jane Doe’ )
$w ( ‘#dropdown1’ ). selectedIndex = foundIndex
if you want to you could do some error handling with the -1 value where it didn’t find what you were looking for