GetCurrentDateTimeUtc() could technically change between one invocation of it and the next (3.99999... to 4.00000...). Use Flow.StartDateTimeUtc to get a fixed value.
You could also just use a single Decision action instead of a switch. Second(Flow.StartDateTimeUtc) %10 < 2 to get 20 percent for example.
------Original Message------
@Charaf Eddine Chemlal there is nothing built-in that I am aware of, as far as a specific action you can use. The only thing I can come up with would be to use a Switch action in a Starting Task to record approximately 10% of Inbound interactions based on a random number generation. I use the remainder of [current seconds] / 10 to approximate 10%, though that's not perfect.
Something like one of the following statements for each path of the switch:
second(GetCurrentDateTimeUtc()) % 10 == 0
second(GetCurrentDateTimeUtc()) % 10 == 1
second(GetCurrentDateTimeUtc()) % 10 == 2
...
second(GetCurrentDateTimeUtc()) % 10 == 8
If I want to record just 10% or so of the calls, then I would use the Enable Participant Recording on just the Default path of the Switch. For a greater percentage, I would enable recording on multiple exit paths from the Switch.
Then I would also have Policies set up which delete all the calls I
do not want to save (such as all Outbound calls on the Trunk).
If you need to ask callers to opt into being recorded, you would do that first, then use this functionality to record a portion of the calls that allow you to record.
Hopefully that is not too confusing.
------------------------------
George Ganahl CCXP, GCA
Principal Technology Consultant
Genesys
------------------------------