JavaScript Actions

Copy to clipboard navigator.clipboard.writeText(content); Get current page name var x = mx.ui.getContentForm().path; var y = x.split('/'); var z = y[1].split('.'); var pageName = z[0]; return pageName; Select all text on input focus Set this JavaScript action on the OnChange nanoflow const activeElement = document.activeElement; if (activeElement.tagName === "INPUT") activeElement.select();

JavaScript API

This section describes various JavaScript code snippets using the Mendix JavaScript client-side API. For the complete documentation, refer to the Mendix docs Session management Remove sessions This can be useful if you’ve exceeded the user limit in your local environment mx.data.get({ xpath: "//System.Session", callback: function (session) { var sessionArray = []; var sessionLength = session.length; for (var i = 0; i < session.length; i++) { sessionArray.push(session[i]._guid); } mx.data.remove({ guids: sessionArray, callback: function () { console....