That should do it provided that selectedIndices isn’t empty. You could also use options instead so it’s based on the full set of options and not just what is currently selected: const singleIndex = [$w('#selectionTags1').options.length - 1]
Also if there were already tags preselected you can clear them by first setting selectedIndices to an empty array before assigning the default value.
Thanks for that - i’m a bit confused. What specifically would I change/add in the code to set a default tag above? The tags are populated through a CMS (eg. tags are A,B,C). The tags filter the content on the page once selected however I want one of them to already be selected on page load.
To set a default value, you will need to add it inside the onReady fuction of the page and the dataset, and NOT inside the onChange function of the selectionTags.
Add this bit of code to your onReady function. This will always select the first tag by default: