Trying to set an App Variable value using Custom HTML Control and the UiPath.App.setVariable in javascript

Welcome to the community @Kay_Rupert!

Have you tried this solution?

Also refer this article