How to randomize values from another field in the schema with certain repetition conditions?

I have a message schema. I want to randomize the id number as values in another field. I also want there to be some repetitions in these values