<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://community.appian.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>email otp</title><link>https://community.appian.com/discussions/f/user-interface/37289/email-otp</link><description>Hi, 
 I have a doubt. I need to send a otp once the user clicks on the action &amp;quot;create record&amp;quot;. 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</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: email otp</title><link>https://community.appian.com/thread/139566?ContentTypeID=1</link><pubDate>Wed, 14 Aug 2024 09:18:04 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:9894359a-fab5-4d6a-8062-94e931b32dcf</guid><dc:creator>Stefan Helzle</dc:creator><description>&lt;p&gt;I would do it this way. All steps happen in one dynamic UI.&lt;/p&gt;
&lt;p&gt;1. Normal record action with a start form&lt;/p&gt;
&lt;p&gt;2. A button &amp;quot;Send OTP&amp;quot; triggers a process in the background that creates the OTP and send it. Store the result from the process to a local.&lt;/p&gt;
&lt;p&gt;3. Display the OTP input field and add a validation that compares the entered value to the stored OTP.&lt;/p&gt;
&lt;p&gt;4. If the OTP is valid, allow the user to proceed.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: email otp</title><link>https://community.appian.com/thread/139561?ContentTypeID=1</link><pubDate>Wed, 14 Aug 2024 07:55:48 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:f46a857f-2554-4e3f-bc6e-1005a45bc153</guid><dc:creator>Hemalatha</dc:creator><description>&lt;p&gt;Thanks for your reply. I have couple of doubts here.&lt;/p&gt;
&lt;p&gt;In my PM, I have a series of email node. One email should be sent once the user opens the form and another email should only be sent when the user submits the form. since I added the start process in the interface, I am getting both the email right after the user opens the form. how can we solve this?&lt;/p&gt;
&lt;p&gt;to validate the OTP, can it be done only after submitting the form. In my case, the user can submit the form only when the otp that the user types in the form matches with the email otp.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Can you please guide here&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: email otp</title><link>https://community.appian.com/thread/139547?ContentTypeID=1</link><pubDate>Wed, 14 Aug 2024 00:23:01 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:a0f3de79-ad21-4848-ac7d-25f076ae16fb</guid><dc:creator>bhavanai654706</dc:creator><description>&lt;h3&gt;1. &lt;strong&gt;Sending OTP Immediately After Opening the Form&lt;/strong&gt;:&lt;/h3&gt;
&lt;p&gt;To send the OTP as soon as the form is opened, you need to ensure the process model starts as soon as the user opens the form. You can achieve this by:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;You should use an interface or related action that triggers the process when the form is opened. This way, the script task that generates the OTP and the email node can execute right after the start node.&lt;/li&gt;
&lt;li&gt;&amp;nbsp;If using an Appian SAIL interface, you could set a &lt;strong&gt;rule input&lt;/strong&gt; or a &lt;strong&gt;saveInto&lt;/strong&gt; in a field that triggers a process model using a start process smart service when the interface is loaded. This will immediately send the OTP as the form is opened.&lt;/li&gt;
&lt;/ol&gt;
&lt;h3&gt;2. &lt;strong&gt;Comparing the OTP Entered by the User&lt;/strong&gt;:&lt;/h3&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Store the OTP&lt;/strong&gt;: When the OTP is generated, store it in a process variable.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;User Input&lt;/strong&gt;: The form where the user enters the OTP should have a text field bound to a rule input (let&amp;rsquo;s call it &lt;code&gt;ri!userOTP&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Validate OTP&lt;/strong&gt;: After the user submits the form, add a gateway in your process model that checks if &lt;code&gt;pv!generatedOTP&lt;/code&gt; (the OTP stored in your process) matches &lt;code&gt;ri!userOTP&lt;/code&gt; (the OTP entered by the user). You can use an XOR gateway to route the flow based on whether the OTPs match or not.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Handle Mismatches&lt;/strong&gt;: If the OTPs don&amp;rsquo;t match, you can either loop back and allow the user to try again or show an error message.&lt;/li&gt;
&lt;/ol&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>