Have a look at this forum post with at least 2 solutions: https://forum.mendix.com/link/questions/82282