Lottery on Shabbat
Question
Following the question whether it is permitted to hold a raffle at the Avot Ubanim program on Shabbat: the children are really looking forward to it on Shabbat; is there nevertheless some solution?
Answer
It is possible to hold the raffle on Friday and pre‑select several winners in a certain order. If the first winner comes on that Shabbat and learns as required, he receives the prize; if not, the prize passes to the second name on the list, and so on.
It is proper not to publicize the name of the child whose name was drawn first but who did not come, because this can cause very great distress that not every child is able to handle, especially if his absence was due to circumstances beyond his control. One can simply announce that the first winner is not present, so they move on to the second winner, and he…
Source
Shulchan Aruch, Orach Chayim 322:6.