email otp

Hi,

I have a doubt. I need to send a otp once the user clicks on the action "create record". While creating they have  a field OTP, where they enters the value that is received via email.

I have used the rand function to generate the random number, I added this logic in a script task and then had the send email node. My question here is:

1. I am receiving the mail for otp after clicking on submit or cancel, but in my PM i have the email node right after the start node. I wanted to receive the otp once after opening the form itself

2. I store the value for the otp in the Process variable in PM. How can we do the comparison if the user enters the code in the form?

Can someone please help here

Thanks in advance.

  Discussion posts and replies are publicly visible