Select x unique random choices from multiple select

Hi, I have a scenario where there can be max of 14 users. We need 9 users or less to proceed. If there are more than 9, then we need to randomly drop (just print it out on the screen) based on additional selections.

I currently have something, but it has its issues.

  1. I cannot use once(random()) because the number of selection is initially zero.
  2. There could be duplications.
    But eventually I would like to avoid the scenario to change if I come back and decide to edit the form. Thanks.

I've attached a sample . random9.xlsx (12.5 KB)

I'm willing to work on XML solution if there are easier ways.

The main idea to random 5 number (example)

This generate a random number between 1 and 5 inclusive.

If 10 selected, remove 1Ids
If 11 selected, remove 2 Ids
If 14 selected, remove 5 Ids

How to make sure I choose unique 'stable' ones? That's the crux of the problem.