Hi All, I am looking for a way to retrieve a random name from a list of names. Is this possible? Can I do this by using microflows only?
Here is my attempt. I retrieve the amount of records in the database table. Then i multiply this with random() [a random number between 0 and 1] as Ronald pointed out. Then i retrieve that specific object from the database using the RandomOffset and a limit of 1. Becauce Mendix sees this result as a list using the head list operation i can convert the list to an object.
When the list is present in your DB you could retrieve it with a custom range. Set limit to 1 and offset to a random integer that you generate with a custom java action. You should be able to find some Java code that gives you a random number from a range. When a DB retrieve is not possible you could try to loop over the list with a counter. When the counter reaches the random number return the current iterator and stop the loop.