<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Get OTP from mail in University Forum</title>
    <link>https://community.blueprism.com/t5/University-Forum/Get-OTP-from-mail/m-p/119108#M4226</link>
    <description>&lt;P&gt;How can I extract an OTP from the body of a text message in Blue Prism after retrieving emails using the Outlook VBO &lt;STRONG&gt;Get Received Items (Basic)&lt;/STRONG&gt; action? The extracted email body is stored in a collection—how do I extract the OTP from it?&lt;/P&gt;&lt;P&gt;Additionally, the action retrieves all emails matching the subject, but I only need the most recent one, which is the last row in the collection, since it's an OTP. How can I ensure only the latest email is processed?&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="blazino17_0-1740688177364.png" style="width: 400px;"&gt;&lt;img src="https://community.blueprism.com/t5/image/serverpage/image-id/40457i3A7CD8775379AFF7/image-size/medium/is-moderation-mode/true?v=v2&amp;amp;px=400" role="button" title="blazino17_0-1740688177364.png" alt="blazino17_0-1740688177364.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2025-02-27 212124.png" style="width: 809px;"&gt;&lt;img src="https://community.blueprism.com/t5/image/serverpage/image-id/40456i34DE0794C1449301/image-size/large/is-moderation-mode/true?v=v2&amp;amp;px=999" role="button" title="Screenshot 2025-02-27 212124.png" alt="Screenshot 2025-02-27 212124.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Thu, 27 Feb 2025 20:31:49 GMT</pubDate>
    <dc:creator>blazino17</dc:creator>
    <dc:date>2025-02-27T20:31:49Z</dc:date>
    <item>
      <title>Get OTP from mail</title>
      <link>https://community.blueprism.com/t5/University-Forum/Get-OTP-from-mail/m-p/119108#M4226</link>
      <description>&lt;P&gt;How can I extract an OTP from the body of a text message in Blue Prism after retrieving emails using the Outlook VBO &lt;STRONG&gt;Get Received Items (Basic)&lt;/STRONG&gt; action? The extracted email body is stored in a collection—how do I extract the OTP from it?&lt;/P&gt;&lt;P&gt;Additionally, the action retrieves all emails matching the subject, but I only need the most recent one, which is the last row in the collection, since it's an OTP. How can I ensure only the latest email is processed?&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="blazino17_0-1740688177364.png" style="width: 400px;"&gt;&lt;img src="https://community.blueprism.com/t5/image/serverpage/image-id/40457i3A7CD8775379AFF7/image-size/medium/is-moderation-mode/true?v=v2&amp;amp;px=400" role="button" title="blazino17_0-1740688177364.png" alt="blazino17_0-1740688177364.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2025-02-27 212124.png" style="width: 809px;"&gt;&lt;img src="https://community.blueprism.com/t5/image/serverpage/image-id/40456i34DE0794C1449301/image-size/large/is-moderation-mode/true?v=v2&amp;amp;px=999" role="button" title="Screenshot 2025-02-27 212124.png" alt="Screenshot 2025-02-27 212124.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 27 Feb 2025 20:31:49 GMT</pubDate>
      <guid>https://community.blueprism.com/t5/University-Forum/Get-OTP-from-mail/m-p/119108#M4226</guid>
      <dc:creator>blazino17</dc:creator>
      <dc:date>2025-02-27T20:31:49Z</dc:date>
    </item>
    <item>
      <title>Re: Get OTP from mail</title>
      <link>https://community.blueprism.com/t5/University-Forum/Get-OTP-from-mail/m-p/119118#M4229</link>
      <description>&lt;P&gt;Hi B,&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;About the last row:&lt;/STRONG&gt;&lt;BR /&gt;The simplest way to get only the last row in a collection is to loop through the collection and save the data for each row to a data item. When you exit the loop after reading the last row, you'll have that last row saved in your data item.&lt;/P&gt;&lt;P&gt;Obviously, this is ok for collection with few rows, if your collection has many rows, you could start with a row count and then access the last row directly by index - which would be the fastest way to do it.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;About the OTP:&lt;/STRONG&gt;&lt;BR /&gt;Can you provide an example what the data looks like so we can determine an easy way to extract the OTP from it?&lt;/P&gt;&lt;P&gt;Happy coding!&lt;BR /&gt;-------------------&lt;BR /&gt;Paul&lt;BR /&gt;Sweden&lt;/P&gt;</description>
      <pubDate>Fri, 28 Feb 2025 09:50:42 GMT</pubDate>
      <guid>https://community.blueprism.com/t5/University-Forum/Get-OTP-from-mail/m-p/119118#M4229</guid>
      <dc:creator>PvD_Sweden</dc:creator>
      <dc:date>2025-02-28T09:50:42Z</dc:date>
    </item>
    <item>
      <title>Re: Get OTP from mail</title>
      <link>https://community.blueprism.com/t5/University-Forum/Get-OTP-from-mail/m-p/119122#M4230</link>
      <description>&lt;P&gt;Thank you so much for responding and assisting, please , This is a sample dataset please note that the OTP is 849331.&lt;/P&gt;&lt;P&gt;From the last row this is the data;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;lt;style&amp;gt;&lt;BR /&gt;_media only screen and (max-width: 600px) {&lt;BR /&gt;table[class=body] h1 {&lt;BR /&gt;font-size: 28px !important;&lt;BR /&gt;margin-bottom: 10px !important;&lt;BR /&gt;}&lt;BR /&gt;table[class=body] p,&lt;BR /&gt;table[class=body] ul,&lt;BR /&gt;table[class=body] ol,&lt;BR /&gt;table[class=body] td,&lt;BR /&gt;table[class=body] span,&lt;BR /&gt;table[class=body] a {&lt;BR /&gt;font-size: 14px !important;&lt;BR /&gt;}&lt;BR /&gt;table[class=body] p.large {&lt;BR /&gt;font-size: 16px !important;&lt;BR /&gt;}&lt;BR /&gt;table[class=body] .wrapper,&lt;BR /&gt;table[class=body] .article {&lt;BR /&gt;padding: 10px !important;&lt;BR /&gt;}&lt;BR /&gt;table[class=body] .content {&lt;BR /&gt;padding: 0 !important;&lt;BR /&gt;}&lt;BR /&gt;table[class=body] .container {&lt;BR /&gt;padding: 0 !important;&lt;BR /&gt;width: 100% !important;&lt;BR /&gt;}&lt;BR /&gt;table[class=body] .main {&lt;BR /&gt;border-left-width: 0 !important;&lt;BR /&gt;border-radius: 0 !important;&lt;BR /&gt;border-right-width: 0 !important;&lt;BR /&gt;}&lt;BR /&gt;table[class=body] .btn table {&lt;BR /&gt;width: 100% !important;&lt;BR /&gt;}&lt;BR /&gt;table[class=body] .btn a {&lt;BR /&gt;width: 100% !important;&lt;BR /&gt;}&lt;BR /&gt;table[class=body] .img-responsive {&lt;BR /&gt;height: auto !important;&lt;BR /&gt;max-width: 100% !important;&lt;BR /&gt;width: auto !important;&lt;BR /&gt;}&lt;BR /&gt;table[class=footer] .center-content {&lt;BR /&gt;width: 100% !important;&lt;BR /&gt;}&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;_media all {&lt;BR /&gt;.ExternalClass {&lt;BR /&gt;width: 100%;&lt;BR /&gt;}&lt;BR /&gt;.ExternalClass,&lt;BR /&gt;.ExternalClass p,&lt;BR /&gt;.ExternalClass span,&lt;BR /&gt;.ExternalClass font,&lt;BR /&gt;.ExternalClass td,&lt;BR /&gt;.ExternalClass div {&lt;BR /&gt;line-height: 100%;&lt;BR /&gt;}&lt;BR /&gt;.apple-link a {&lt;BR /&gt;color: inherit !important;&lt;BR /&gt;font-family: inherit !important;&lt;BR /&gt;font-size: inherit !important;&lt;BR /&gt;font-weight: inherit !important;&lt;BR /&gt;line-height: inherit !important;&lt;BR /&gt;text-decoration: none !important;&lt;BR /&gt;}&lt;BR /&gt;.btn-primary table td:hover {&lt;BR /&gt;background-color: #34495e !important;&lt;BR /&gt;}&lt;BR /&gt;.btn-primary a:hover {&lt;BR /&gt;background-color: #34495e !important;&lt;BR /&gt;border-color: #34495e !important;&lt;BR /&gt;}&lt;BR /&gt;}&lt;BR /&gt;&amp;lt;/style&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;lt;table border="0" cellpadding="0" cellspacing="0" class="body" style="border-collapse: separate; mso-table-lspace: 0pt; mso-table-rspace: 0pt; width: 100%; background-color: #f6f6f6;"&amp;gt;&lt;BR /&gt;&amp;lt;tbody&amp;gt;&amp;lt;tr&amp;gt;&lt;BR /&gt;&amp;lt;td style="font-family: Arial, sans-serif; font-size: 14px; vertical-align: top;"&amp;gt;&amp;amp;nbsp;&amp;lt;/td&amp;gt;&lt;BR /&gt;&amp;lt;td class="container" style="font-family: Arial, sans-serif; font-size: 14px; vertical-align: top; display: block; Margin: 0 auto; max-width: 600px; padding: 10px; width: 600px;"&amp;gt;&lt;BR /&gt;&amp;lt;div class="content" style="box-sizing: border-box; display: block; Margin: 0 auto; max-width: 600px;"&amp;gt;&lt;BR /&gt;&amp;lt;span class="preheader" style="color: transparent; display: none; height: 0; max-height: 0; max-width: 0; cpacity: 0; overflow: hidden; mso-hide: all; visibility: hidden; width: 0;"&amp;gt;&lt;BR /&gt;Join cpay merchant&lt;BR /&gt;&amp;lt;/span&amp;gt;&lt;BR /&gt;&amp;lt;div class="header" style="clear: both;text-align: center; width: 100%;"&amp;gt;&lt;BR /&gt;&amp;lt;table border="0" cellpadding="0" cellspacing="0" style="line-height: 0;border-collapse: separate; mso-table-lspace: 0pt; mso-table-rspace: 0pt; width: 100%;"&amp;gt;&lt;BR /&gt;&amp;lt;tbody&amp;gt;&amp;lt;tr&amp;gt;&lt;BR /&gt;&amp;lt;td class="content-block" style="font-family: Arial, sans-serif; font-size: 12px; color: #999999; text-align: center;"&amp;gt;&lt;BR /&gt;&amp;lt;img src="&lt;A href="https://cpaywebcom.s3-eu-west-1.amazonaws.com/images/email/merchantEmailVerify.png" target="_blank"&gt;https://cpaywebcom.s3-eu-west-1.amazonaws.com/images/email/merchantEmailVerify.png&lt;/A&gt; " alt="Welcome to cpay!" width="100%"&amp;gt;&lt;BR /&gt;&amp;lt;/td&amp;gt;&lt;BR /&gt;&amp;lt;/tr&amp;gt;&lt;BR /&gt;&amp;lt;/tbody&amp;gt;&amp;lt;/table&amp;gt;&lt;BR /&gt;&amp;lt;/div&amp;gt;&lt;BR /&gt;&amp;lt;table class="main" style="border-collapse: separate; mso-table-lspace: 0pt; mso-table-rspace: 0pt; width: 100%; background: #fafdff; border-radius: 3px;"&amp;gt;&lt;BR /&gt;&amp;lt;tbody&amp;gt;&amp;lt;tr&amp;gt;&lt;BR /&gt;&amp;lt;td class="wrapper" style="font-family: Arial, sans-serif; font-size: 14px; vertical-align: top; box-sizing: border-box; padding: 24px; padding-top: 24px !important;"&amp;gt;&lt;BR /&gt;&amp;lt;table border="0" cellpadding="0" cellspacing="0" style="border-collapse: separate; mso-table-lspace: 0pt; mso-table-rspace: 0pt; width: 100%;"&amp;gt;&lt;BR /&gt;&amp;lt;tbody&amp;gt;&amp;lt;tr&amp;gt;&lt;BR /&gt;&amp;lt;td style="font-family: Arial, sans-serif; font-size: 14px; letter-spacing: 0.4px; vertical-align: top;"&amp;gt;&lt;BR /&gt;&amp;lt;p style="font-family: Arial, sans-serif; font-size: 14px; margin-top: 0; color: #474747; margin-bottom: 24px;"&amp;gt;&lt;BR /&gt;Dear&lt;BR /&gt;&amp;lt;/p&amp;gt;&lt;BR /&gt;&amp;lt;p style="font-family: Arial, sans-serif; font-size: 14px; font-weight: normal; color: #474747;"&amp;gt;&lt;BR /&gt;&amp;lt;/p&amp;gt;&lt;BR /&gt;Your cPay verification code is&lt;BR /&gt;&amp;lt;p style="font-family: Arial, sans-serif; font-size: 16px; font-weight: normal; color: #3366FF;"&amp;gt;&lt;BR /&gt;849331&lt;BR /&gt;&amp;lt;/p&amp;gt;&lt;BR /&gt;DO NOT DISCLOSE!!! &amp;lt;br&amp;gt;&lt;BR /&gt;Sharing this code will cause account theft and financial loss.&lt;BR /&gt;The verification code expires in 5 minutes.&lt;BR /&gt;&amp;lt;p style="font-family: Arial, sans-serif; font-size: 14px; font-weight: normal; color: #474747; margin-bottom: 16px;"&amp;gt;&lt;BR /&gt;If you don't know why you got this email,please contact us:&lt;BR /&gt;&amp;lt;/p&amp;gt;&lt;BR /&gt;&amp;lt;p style="font-family: Arial, sans-serif; font-size: 14px; font-weight: normal; color: #474747;"&amp;gt;&lt;BR /&gt;Email:&lt;/P&gt;&lt;P&gt;&amp;lt;a style="color:#1dcf9f" href="mailto:ng-support@cpay-inc.com"&amp;gt; ng-support@cpay-inc.com&amp;lt;/a&amp;gt;&lt;BR /&gt;&amp;lt;br&amp;gt; Phone:&lt;BR /&gt;&amp;lt;a style="color:#1dcf9f" href="tel:+23418822222"&amp;gt; 0700 8833333 &amp;lt;/a&amp;gt;&lt;BR /&gt;&amp;lt;/p&amp;gt;&lt;BR /&gt;&amp;lt;p style="font-family: Arial, sans-serif; font-size: 14px; font-weight: normal; margin: 0;color: #474747;"&amp;gt;&lt;BR /&gt;Thank you for choosing cPay&lt;BR /&gt;&amp;lt;br&amp;gt; The cPay team&lt;BR /&gt;&amp;lt;br&amp;gt; If you received this email by mistake, you can safely ignore it.&lt;BR /&gt;&amp;lt;/p&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;lt;/td&amp;gt;&lt;BR /&gt;&amp;lt;/tr&amp;gt;&lt;BR /&gt;&amp;lt;/tbody&amp;gt;&amp;lt;/table&amp;gt;&lt;BR /&gt;&amp;lt;/td&amp;gt;&lt;BR /&gt;&amp;lt;/tr&amp;gt;&lt;BR /&gt;&amp;lt;tr&amp;gt;&lt;BR /&gt;&amp;lt;td class="wrapper" style="vertical-align: top; box-sizing: border-box; padding: 24px"&amp;gt;&lt;BR /&gt;&amp;lt;table class="footer" border="0" cellpadding="0" cellspacing="0" style="border-collapse: separate; mso-table-lspace: 0pt; mso-table-rspace: 0pt; width: 100%; border-top:1px solid #bfc5c4"&amp;gt;&lt;BR /&gt;&amp;lt;tbody&amp;gt;&amp;lt;tr&amp;gt;&lt;BR /&gt;&amp;lt;td class="content-block" style="font-family: Arial, sans-serif; vertical-align: top; padding-bottom: 8px; padding-top: 8px; text-align: center;"&amp;gt;&lt;BR /&gt;&amp;lt;p style="width: 100%"&amp;gt;&lt;BR /&gt;&amp;lt;span class="apple-link center-content" style="font-size: 12px; line-height: 1.33; letter-spacing: 0.4px; color: #bfc5c4; display: inline-block; width: 375px;"&amp;gt;&lt;BR /&gt;cPay Digital Services Limited, yuyund floor, ttpyul House, Plot 6&lt;BR /&gt;&amp;lt;br&amp;gt;Dr Nerurren Olssopqqo tyy, Artusa - Ierja, tygys&lt;BR /&gt;&amp;lt;/span&amp;gt;&lt;BR /&gt;&amp;lt;/p&amp;gt;&lt;BR /&gt;&amp;lt;/td&amp;gt;&lt;BR /&gt;&amp;lt;/tr&amp;gt;&lt;BR /&gt;&amp;lt;/tbody&amp;gt;&amp;lt;/table&amp;gt;&lt;BR /&gt;&amp;lt;/td&amp;gt;&lt;BR /&gt;&amp;lt;/tr&amp;gt;&lt;BR /&gt;&amp;lt;/tbody&amp;gt;&amp;lt;/table&amp;gt;&lt;BR /&gt;&amp;lt;/div&amp;gt;&lt;BR /&gt;&amp;lt;/td&amp;gt;&lt;BR /&gt;&amp;lt;td style="font-family: Arial, sans-serif; font-size: 14px; vertical-align: top;"&amp;gt;&amp;amp;nbsp;&amp;lt;/td&amp;gt;&lt;BR /&gt;&amp;lt;/tr&amp;gt;&lt;BR /&gt;&amp;lt;/tbody&amp;gt;&amp;lt;/table&amp;gt;&lt;BR /&gt;&amp;lt;/div&amp;gt;&lt;/P&gt;</description>
      <pubDate>Fri, 28 Feb 2025 10:47:30 GMT</pubDate>
      <guid>https://community.blueprism.com/t5/University-Forum/Get-OTP-from-mail/m-p/119122#M4230</guid>
      <dc:creator>blazino17</dc:creator>
      <dc:date>2025-02-28T10:47:30Z</dc:date>
    </item>
    <item>
      <title>Re: Get OTP from mail</title>
      <link>https://community.blueprism.com/t5/University-Forum/Get-OTP-from-mail/m-p/119123#M4231</link>
      <description>&lt;P&gt;Hi B,&lt;/P&gt;&lt;P&gt;Assuming the data always looks like that, I'd probably scan for the element containing '&lt;FONT face="courier new,courier"&gt;&lt;SPAN&gt;Your cPay verification code is&lt;/SPAN&gt;&lt;/FONT&gt;' using&amp;nbsp;&lt;FONT face="courier new,courier"&gt;InStr()&amp;nbsp;&lt;/FONT&gt;to get the position. and then read forward to the line with the OTP that follows that element. Whatever comes between '&lt;FONT face="courier new,courier"&gt;&amp;gt;&lt;/FONT&gt;' and '&lt;FONT face="courier new,courier"&gt;&lt;SPAN&gt;&amp;lt;/p&amp;gt;&lt;/SPAN&gt;&lt;/FONT&gt;' after the found position would be your OTP.&lt;/P&gt;&lt;P&gt;Alternatively, if you're handy with &lt;A href="https://regex101.com/r/dhecWA/1/" target="_self"&gt;Regex&lt;/A&gt;&amp;nbsp;(...I'm not...), you could use that to directly extract the OTP från the XML data using similar matching criteria as above.&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Happy coding!&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;-------------------&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Paul&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Sweden&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 28 Feb 2025 11:00:52 GMT</pubDate>
      <guid>https://community.blueprism.com/t5/University-Forum/Get-OTP-from-mail/m-p/119123#M4231</guid>
      <dc:creator>PvD_Sweden</dc:creator>
      <dc:date>2025-02-28T11:00:52Z</dc:date>
    </item>
    <item>
      <title>Re: Get OTP from mail</title>
      <link>https://community.blueprism.com/t5/University-Forum/Get-OTP-from-mail/m-p/119144#M4233</link>
      <description>&lt;P&gt;Please i need further clarification on&amp;nbsp;&lt;SPAN&gt;using&amp;nbsp;&lt;/SPAN&gt;&lt;FONT face="courier new,courier"&gt;InStr()&amp;nbsp;&lt;/FONT&gt;&lt;SPAN&gt;to get the position. and then read forward to the line with the OTP that follows that element. Whatever comes between '&lt;/SPAN&gt;&lt;FONT face="courier new,courier"&gt;&amp;gt;&lt;/FONT&gt;&lt;SPAN&gt;' and '&lt;/SPAN&gt;&lt;FONT face="courier new,courier"&gt;&lt;SPAN&gt;&amp;lt;/p&amp;gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;SPAN&gt;' after the found position would be your OTP.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;i have been getting lots of errors&amp;nbsp; for 2 days straight now. I have not been able to achieve this. Could you please be more direct and explanatory?&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 03 Mar 2025 10:50:05 GMT</pubDate>
      <guid>https://community.blueprism.com/t5/University-Forum/Get-OTP-from-mail/m-p/119144#M4233</guid>
      <dc:creator>blazino17</dc:creator>
      <dc:date>2025-03-03T10:50:05Z</dc:date>
    </item>
  </channel>
</rss>

