<?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>If Not Statement with @ Sign</title><link>https://community.appian.com/discussions/f/general/17388/if-not-statement-with-sign</link><description>Hello. I want to have a space for users to enter their email address. I want to make it so that you have to enter an @ sign. What would the validation look like for this? Thanks</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: If Not Statement with @ Sign</title><link>https://community.appian.com/thread/68492?ContentTypeID=1</link><pubDate>Tue, 30 Jul 2019 16:48:49 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:218f8dfe-bebe-45d7-a7d0-cf738952b502</guid><dc:creator>Mike Schmitt</dc:creator><description>&lt;p&gt;No prob - but just be aware (if it matters for your use case) that this logic will also allow a user to enter a lot of things that are not a valid email address - like &amp;quot;mike@&amp;quot;, or &amp;quot;@test&amp;quot;, or &amp;quot;mike@@test.com&amp;quot; (and various other incorrect permutations).&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: If Not Statement with @ Sign</title><link>https://community.appian.com/thread/68491?ContentTypeID=1</link><pubDate>Tue, 30 Jul 2019 16:39:43 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:eb9193ac-ad20-4362-bab4-e13d91b05cec</guid><dc:creator>benjamins0003</dc:creator><description>&lt;p&gt;Perfect. Thanks&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: If Not Statement with @ Sign</title><link>https://community.appian.com/thread/68489?ContentTypeID=1</link><pubDate>Tue, 30 Jul 2019 16:27:34 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:d1bfac56-5f5c-435b-8ce1-8efa3ca7ff8d</guid><dc:creator>Mike Schmitt</dc:creator><description>&lt;p&gt;If you&amp;#39;re only interested in checking for the presence of the &amp;quot;@&amp;quot; in your validation (and validation message), then it&amp;#39;s fairly easy to just use standard logic in the Validations: parameter of your text input field.&lt;/p&gt;
&lt;p&gt;It would be accomplished with code similar to this:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="java"&gt;a!textField(
  value: ri!email,
  saveInto: ri!email,
  validations: {
    if(
      not(like(ri!email, &amp;quot;*@*&amp;quot;)),
      &amp;quot;email address must contain an &amp;#39;@&amp;#39; sign.&amp;quot;,
      null()
    )
  }
)&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: If Not Statement with @ Sign</title><link>https://community.appian.com/thread/68488?ContentTypeID=1</link><pubDate>Tue, 30 Jul 2019 16:23:54 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:a680d461-5f15-45af-97ba-d7580c5d7fc8</guid><dc:creator>Mike Schmitt</dc:creator><description>&lt;p&gt;In case you or anyone else wants my code for this, here is the current version:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="java"&gt;/*  Email Address Validation for Appian  */
  /*  Allows the &amp;#39;name&amp;#39; to contain letters, numbers, plus period and special characters: _ - + &amp;#39; &amp;amp; %  */
  /*  Allows the &amp;#39;domain&amp;#39; to contain only letters, numbers, period and dash.  */

if(
  or(
    isnull(trim(ri!address)),
    len(trim(ri!address)) &amp;gt; 255,
    length(split(trim(ri!address), &amp;quot; &amp;quot;)) &amp;gt; 1,
    count(split(ri!address, &amp;quot;@&amp;quot;)) &amp;lt;&amp;gt; 2
  ),
  false(),
  
  with(
    local!userPart: split(trim(ri!address),&amp;quot;@&amp;quot;)[1],
    local!domainPart: split(trim(ri!address),&amp;quot;@&amp;quot;)[2],
    
    if(
      or(
        length(split(local!domainPart, &amp;quot;.&amp;quot;)) &amp;lt; 2,
        contains(split(local!userPart, &amp;quot;.&amp;quot;), &amp;quot;&amp;quot;),
        contains(split(local!domainPart, &amp;quot;.&amp;quot;), &amp;quot;&amp;quot;),
        not(isnull(stripwith(lower(local!domainPart), &amp;quot;abcdefghijklmnopqrstuvwxyz1234567890-.&amp;quot;))),
        not(isnull(stripwith(lower(local!userPart), &amp;quot;abcdefghijklmnopqrstuvwxyz1234567890-._+&amp;#39;&amp;amp;%&amp;quot;)))
      ),
        
      false(),
      true()
    )
  )
)&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Saved as an Expression Rule, this code simply returns True or False, referring to whether a&amp;nbsp;given email address is valid.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: If Not Statement with @ Sign</title><link>https://community.appian.com/thread/68487?ContentTypeID=1</link><pubDate>Tue, 30 Jul 2019 16:15:09 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:d0336d86-05a2-4164-b144-f16d8d868cc9</guid><dc:creator>benjamins0003</dc:creator><description>&lt;p&gt;Thank you, Mike, that&amp;#39;s very nice of you, I will consider it&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: If Not Statement with @ Sign</title><link>https://community.appian.com/thread/68486?ContentTypeID=1</link><pubDate>Tue, 30 Jul 2019 16:14:49 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:c7a3a0b2-8a12-4b61-8e07-dd59fb691e4c</guid><dc:creator>benjamins0003</dc:creator><description>&lt;p&gt;Hello! This works very well. I have one other question. How may I change this code to accommodate a message? For ex: &amp;quot;Please Use &amp;#39;@&amp;#39;&amp;quot;? Thanks&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: If Not Statement with @ Sign</title><link>https://community.appian.com/thread/68458?ContentTypeID=1</link><pubDate>Mon, 29 Jul 2019 14:45:06 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:544382d9-f3a7-4d0c-b8fd-c146c97f8a48</guid><dc:creator>Mike Schmitt</dc:creator><description>&lt;p&gt;If you&amp;#39;d like a validation to make sure a user enters a syntactically-correct full email address, I have an expression rule that uses only out-of-box features that works rather well which i&amp;#39;ve posted here in the past, and would be willing to look up and repost for you if needed.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: If Not Statement with @ Sign</title><link>https://community.appian.com/thread/68455?ContentTypeID=1</link><pubDate>Mon, 29 Jul 2019 13:52:22 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:945587c1-941b-4175-8078-152d448f8870</guid><dc:creator>davel001150</dc:creator><description>&lt;p&gt;not(&lt;/p&gt;
&lt;p&gt;like( ri!emailAddress, &amp;quot;*@*&amp;quot;)&lt;/p&gt;
&lt;p&gt;)&lt;/p&gt;
&lt;p&gt;See how this works&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>