โ04-27-2026 03:44 AM
Hi everyone,
I need to generate a random 6-digit code (OTP style) in a recipe.
Is there a way to do this using a Workato formula?
If not, what is the recommended/best practice way to implement it?
Thanks in advance!
โ04-28-2026 06:23 PM - edited โ04-28-2026 06:24 PM
Hi @shaked,
I believe there is no way to generate a code with any FORMULA, we need to go with any scripting (Python, Ruby, JS). Please check the below output which i got from Python code.
import random
def main(input):
otp = random.randint(100000, 999999)
return {"otp": otp}Thanks,
J Rajesh Kumar.