<?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>Phone number validation</title><link>https://community.appian.com/discussions/f/user-interface/11731/phone-number-validation</link><description>Hi everyone, i just wanna put phone number validation into my interface. The field should take only numbers &amp;amp; length should be 10 digits. Can any one help me out.</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: Phone number validation</title><link>https://community.appian.com/thread/85613?ContentTypeID=1</link><pubDate>Thu, 09 Sep 2021 01:23:28 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:518efba9-846b-4ca4-89a5-d8e02f8a58a7</guid><dc:creator>vimalkumars</dc:creator><description>&lt;p&gt;&lt;a class="internal-link view-user-profile" href="/members/priyankaa0003"&gt;priyankaappana&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;/a&gt;, Use a text field and apply any of the below suggested validations&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;a href="/discussions/f/user-interface/11731/phone-number-validation/51898#51898"&gt;https://community.appian.com/discussions/f/user-interface/11731/phone-number-validation/51898#51898&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://community.appian.com/discussions/f/user-interface/11731/phone-number-validation/51942#51942"&gt;community.appian.com/.../51942&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Phone number validation</title><link>https://community.appian.com/thread/85511?ContentTypeID=1</link><pubDate>Mon, 06 Sep 2021 13:43:27 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:465b7c27-542c-4582-afa4-d0de7c44a9dd</guid><dc:creator>priyankaappana</dc:creator><description>&lt;p&gt;throwing error when phone number exceeding the intergerField() range and value is getting modified to infinity symbol.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Phone number validation</title><link>https://community.appian.com/thread/52046?ContentTypeID=1</link><pubDate>Sun, 28 Jan 2018 09:52:20 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:d474195c-a59d-4e36-b229-946412f2f587</guid><dc:creator>Singh002</dc:creator><description>&lt;a href="/members/narmadap"&gt;Narmada&lt;/a&gt;  Thanks for verifying the answer.&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Phone number validation</title><link>https://community.appian.com/thread/51957?ContentTypeID=1</link><pubDate>Wed, 24 Jan 2018 15:10:09 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:271e9572-aa8f-4959-ac66-5291d856b256</guid><dc:creator>sowjanyav430</dc:creator><description>@ Narmada,&lt;br /&gt;
Please try the below code:&lt;br /&gt;
&lt;br /&gt;
 if(&lt;br /&gt;
	AND(&lt;br /&gt;
	  not(&lt;br /&gt;
		rule!APN_isBlank(&lt;br /&gt;
		  ri!phoneNumber&lt;br /&gt;
		)&lt;br /&gt;
	  ),&lt;br /&gt;
	  len(&lt;br /&gt;
		ri!phoneNumber&lt;br /&gt;
	  ) &amp;lt; 11&lt;br /&gt;
	),&lt;br /&gt;
	if(&lt;br /&gt;
	  like(&lt;br /&gt;
		ri!phoneNumber,&lt;br /&gt;
		&amp;quot;[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]&amp;quot;&lt;br /&gt;
	  ),&lt;br /&gt;
	  {},&lt;br /&gt;
	  &amp;quot;Enter 10 digits Phone number&amp;quot;&lt;br /&gt;
	),&lt;br /&gt;
	{}&lt;br /&gt;
  )&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Regards,&lt;br /&gt;
Sowjanya&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Phone number validation</title><link>https://community.appian.com/thread/51947?ContentTypeID=1</link><pubDate>Wed, 24 Jan 2018 09:36:12 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:8032142f-e8e9-46c2-89ff-4be762909576</guid><dc:creator>sahilb346</dc:creator><description>&lt;p&gt;Hi Narmada,&lt;br /&gt; &lt;br /&gt; You can use the below to resolvbe your issue,&lt;br /&gt; a!integerField(&lt;br /&gt; label: &amp;quot;PhoneNumber&amp;quot;,&lt;br /&gt; value:local!phoneNumber,&lt;br /&gt; saveInto: local!phoneNumber,&lt;br /&gt; required: true(),&lt;br /&gt; validations:if(len(local!phoneNumber)=10, {},&amp;quot;Enter 10 digits only&amp;quot;)&lt;br /&gt; &lt;br /&gt; &lt;br /&gt; )&lt;br /&gt; &lt;br /&gt; the local!phoneNumber Is declared in load() and the a!integerField() is using under Form Layout.&lt;br /&gt; &lt;br /&gt; Hope this will help.&lt;br /&gt; &lt;br /&gt; Thanks&lt;br /&gt; Sahil&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Phone number validation</title><link>https://community.appian.com/thread/51942?ContentTypeID=1</link><pubDate>Wed, 24 Jan 2018 03:51:58 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:c3cfec31-de2f-44ef-9bc6-41b748a36563</guid><dc:creator>Thasneem Nisa </dc:creator><description>Hi &lt;a href="/members/narmadap"&gt;Narmada&lt;/a&gt; , Following rule might help you in validating mobile numbers of 4 different formats. Additional formats can also be added, if needed. &lt;br /&gt;
&lt;br /&gt;
if(&lt;br /&gt;
  isnull(&lt;br /&gt;
    ri!mobileNumber&lt;br /&gt;
  ),&lt;br /&gt;
  null,&lt;br /&gt;
  or(&lt;br /&gt;
    regexmatch(&lt;br /&gt;
      &amp;quot;^(\+\d{1,3}[- ]?)?\d{10}$&amp;quot;,&lt;br /&gt;
      ri!mobileNumber&lt;br /&gt;
    ),&lt;br /&gt;
    regexmatch(&lt;br /&gt;
      &amp;quot;^(\([0-9]{3}\) |[0-9]{3}-)[0-9]{3}-[0-9]{4}$&amp;quot;,&lt;br /&gt;
      ri!mobileNumber&lt;br /&gt;
    ),&lt;br /&gt;
    regexmatch(&lt;br /&gt;
      &amp;quot;^\([0-9]{3}\)[0-9]{3}-[0-9]{4}$&amp;quot;,&lt;br /&gt;
      ri!mobileNumber&lt;br /&gt;
    ),&lt;br /&gt;
    regexmatch(&lt;br /&gt;
      &amp;quot;^\+[0-9]{10,20}$&amp;quot;,&lt;br /&gt;
      ri!mobileNumber&lt;br /&gt;
    )&lt;br /&gt;
  ),&lt;br /&gt;
  null,&lt;br /&gt;
  {&lt;br /&gt;
    &amp;quot;Invalid mobile number.&amp;quot;,&lt;br /&gt;
    &amp;quot;Valid formats (555)555-5555 or 555-555-5555 or 1234567890 or +1234567890&amp;quot;&lt;br /&gt;
  }&lt;br /&gt;
)&lt;br /&gt;
&lt;br /&gt;
Please note that, you need to install this plugin to use this function &lt;a href="https://community.appian.com/b/appmarket/posts/regular-expression-functions"&gt;community.appian.com/.../regular-expression-functions&lt;/a&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Phone number validation</title><link>https://community.appian.com/thread/51898?ContentTypeID=1</link><pubDate>Mon, 22 Jan 2018 17:39:53 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:2f856740-74e1-4cb3-94e2-91bcb5a12e94</guid><dc:creator>Singh002</dc:creator><description>You can try below code:&lt;br /&gt;
load(&lt;br /&gt;
  local!number:&amp;quot;1234567890&amp;quot;,&lt;br /&gt;
  like(local!number,&amp;quot;[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]&amp;quot;)&lt;br /&gt;
)&lt;br /&gt;
&lt;br /&gt;
Thanks&lt;br /&gt;
Abhishek&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Phone number validation</title><link>https://community.appian.com/thread/51837?ContentTypeID=1</link><pubDate>Thu, 18 Jan 2018 11:35:38 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:346e1ed6-5dd2-4cdb-9760-2ab09dbfd5b4</guid><dc:creator>aloks0189</dc:creator><description>Hi Narmada, &lt;br /&gt;
You can create a rule and write following content inside it:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
if(&lt;br /&gt;
  or(fn!isnull(ri!data_anyType),ri!data_anyType=&amp;quot;&amp;quot;),&lt;br /&gt;
  true(),&lt;br /&gt;
  length(ri!data_anyType) = 0&lt;br /&gt;
)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Where data_anyType is a rule input of type anytype&lt;br /&gt;
&lt;br /&gt;
Hope this will help you.&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Phone number validation</title><link>https://community.appian.com/thread/51836?ContentTypeID=1</link><pubDate>Thu, 18 Jan 2018 09:52:07 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:76d149e9-3ad0-48ba-9c40-dbad35ad2956</guid><dc:creator>Jayapriya Muthu</dc:creator><description>You have to install a plugin named as Appian Regular Expression Functions, at following URL&lt;br /&gt;
&lt;br /&gt;
&lt;a href="https://forum.appian.com/suite/tempo/records/item/lMBCLGOdlMUpdGVqW3dQaIKmclBmvvNEj8vu_cjb7T-5YiPr4Fu8ly5Yj1s09uenE4RYzA8zKyx7eiUhemjLnMWmh9flkoBj4U4HmAkkPRpCPt5Lw/view/summary"&gt;forum.appian.com/.../summary&lt;/a&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Phone number validation</title><link>https://community.appian.com/thread/51835?ContentTypeID=1</link><pubDate>Thu, 18 Jan 2018 09:27:36 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:a71b9dc6-4456-463f-a100-e1aab43f3bcd</guid><dc:creator>Narmada</dc:creator><description>Hi lokesh, regexmatch function is not available in Appian.&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Phone number validation</title><link>https://community.appian.com/thread/51832?ContentTypeID=1</link><pubDate>Thu, 18 Jan 2018 08:47:13 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:d45ec1cc-b4d6-41b2-87ec-5b92bfdaac2e</guid><dc:creator>lokeshk822</dc:creator><description>use the below regex, it will help you:&lt;br /&gt;
&lt;br /&gt;
if(len(&lt;br /&gt;
            local!variable&lt;br /&gt;
          )&amp;gt;10,cons!WARNING_MESG,&lt;br /&gt;
           &lt;br /&gt;
        {&lt;br /&gt;
         if(&lt;br /&gt;
                     not(regexmatch(&amp;quot;^([0-9]{1,10})$&amp;quot;,local!variable)),&lt;br /&gt;
                        &amp;quot;Warning message&amp;quot;,&lt;br /&gt;
                        {}&lt;br /&gt;
                  )})&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Phone number validation</title><link>https://community.appian.com/thread/51831?ContentTypeID=1</link><pubDate>Thu, 18 Jan 2018 08:42:17 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:757f48ff-de88-4a3f-89c0-fabbdaeed82f</guid><dc:creator>Narmada</dc:creator><description>Hi aloks, can you please tell me what you done on expression rule-rule!APN_isBlank&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Phone number validation</title><link>https://community.appian.com/thread/51827?ContentTypeID=1</link><pubDate>Thu, 18 Jan 2018 07:28:02 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:7df7f4ff-c3dc-41da-acbd-151fdd18f549</guid><dc:creator>aloks0189</dc:creator><description>Also, just a quick thought, if your application will be used across indian origin only, then this validation will work fine for you. &lt;br /&gt;
&lt;br /&gt;
But if your application will be used across multiple countries, then this validation won&amp;#39;t work for you, because number of digits for a valid mobile number varies from country to country.&lt;br /&gt;
&lt;br /&gt;
Hence, if it&amp;#39;s the case,. Your rule must be dynamic and configurable.&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Phone number validation</title><link>https://community.appian.com/thread/51825?ContentTypeID=1</link><pubDate>Thu, 18 Jan 2018 07:19:15 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:72d56f5c-aebf-4a52-ad21-af24f237ea8e</guid><dc:creator>aloks0189</dc:creator><description>Hi &lt;a href="/members/narmadap"&gt;Narmada&lt;/a&gt;  please make sure that, you are performing null check before evaluating length() because length() throws an error if the value is null.&lt;br /&gt;
&lt;br /&gt;
So you can do it in following way:&lt;br /&gt;
&lt;br /&gt;
if(&lt;br /&gt;
rule!APN_isBlank(local!phoneNumber),&lt;br /&gt;
{},&lt;br /&gt;
if(&lt;br /&gt;
length(local!PhoneNumber) &amp;gt; 10,&amp;quot;Maximum 10 digits are allowed&amp;quot;,{}&lt;br /&gt;
)&lt;br /&gt;
)&lt;br /&gt;
&lt;br /&gt;
Hope this will help you&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Phone number validation</title><link>https://community.appian.com/thread/51823?ContentTypeID=1</link><pubDate>Thu, 18 Jan 2018 05:51:12 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:5f1a8206-a1c6-40a4-81db-c8b593860fa2</guid><dc:creator>Vinay Kumar Rai</dc:creator><description>&lt;p&gt;HI,&lt;br /&gt; &lt;br /&gt; Use IntegerField component, it only allow numbers,&lt;br /&gt; &lt;br /&gt; for length validation &lt;br /&gt; &lt;br /&gt; =a!integerField(&lt;br /&gt; label: &amp;quot;Reference Number&amp;quot;,&lt;br /&gt; value: local!PhoneNumber,&lt;br /&gt; saveInto: local!PhoneNumber,&lt;br /&gt; validations:if(&lt;br /&gt; length(local!PhoneNumber) &amp;gt; 10,&amp;quot;Maximum 10 digits are allowed&amp;quot;,&amp;quot;&amp;quot;&lt;br /&gt; )&lt;br /&gt; )&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Phone number validation</title><link>https://community.appian.com/thread/51822?ContentTypeID=1</link><pubDate>Thu, 18 Jan 2018 05:48:42 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:e10fa9e2-1052-4190-b0f5-1298a64b795a</guid><dc:creator>Jayapriya Muthu</dc:creator><description>Hi,&lt;br /&gt;
Try to use a!integerField(). This will throw a validation message if any non-numerical characters are input. Then you can simply check - variable &amp;gt; 10 to show validation message&lt;br /&gt;
&lt;br /&gt;
If you want to include hyphen or any phone number format then use regexmatch function. You can get the pattern from Google.&lt;br /&gt;
&lt;br /&gt;
If you have to use a text field, you can also use cleanwith or stripwith function to perform validations.&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>