Maybe this component might help https://marketplace.mendix.com/link/component/50833 or at least give you an idea on how to accomplish this.