Convert this to work with Wix Code?

Yes exactly,
In the live example you click the confirm tags button and it populates all the selected tags’ values into the text input. I have that text input field connected to a dataset and so when I submit the form it will save the input to the collection.