Hi Abhishek,
You can do this by using a microflow and a java action,
First, retrieve all the objects of an entity and then
You can use the Math.random()
JavaScript function in a Java action to generate a random number and sort the list based on this number.
Here are the general steps to do this:
List<yourEntity>
to the Java action.
import java.util.*;
public class YourJavaActionName {
public static List<yourEntity> shuffleList(List<yourEntity> inputList) {
List<yourEntity> list = new ArrayList<>(inputList);
Collections.shuffle(list, new Random(System.currentTimeMillis()));
return list;
}
}
Hope it helps!!
You could also do this without a java action.