Convert this to work with Wix Code?

I think the other thread is using a more correct approach, I’ll answer there.