Hi,
I created a button to generate random codes. But there is a issue.
When I generate a code ex. in for the locker 1 it gives the code 6228

If I create a code to the locker 2 it gives 1866

The issue is this, if I go back to edit something in the locker 1 it replaces the last number generated, in this case from the locker 2 and so on.

What can I do to avoid this?
Thanks in advance!
Extra Info
Button - OnSelect: UpdateContext({VarRandValue:(RoundDown(9999 * Rand(), 0))})
DataCardValue TextInput - Default: If(
IsBlank(VarRandValue),
"",
Len(Text(VarRandValue)) = 1,
Concatenate(
"000",
Text(VarRandValue)
),
Len(Text(VarRandValue)) = 2,
Concatenate(
"00",
Text(VarRandValue)
),
Len(Text(VarRandValue)) = 3,
Concatenate(
"0",
Text(VarRandValue)
),
Text(VarRandValue)
)