<?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 Re: Phone Number Verifier in Quick Measures Gallery</title>
    <link>https://community.fabric.microsoft.com/t5/Quick-Measures-Gallery/Phone-Number-Verifier/m-p/1565922#M653</link>
    <description>&lt;P&gt;Thanks&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="313" data-lia-user-login="Greg_Deckler" class="lia-mention lia-mention-user"&gt;Greg_Deckler&lt;/a&gt;&amp;nbsp;, it looks awesome now.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Good luck with the international country codes. As I mentioned, we have no fixed length for phone numbers in in NZ, nor is there a set way to display them. Mobile numbers can be for example:&amp;nbsp;&lt;/P&gt;
&lt;P&gt;021 123 4567&lt;/P&gt;
&lt;P&gt;027 1234 5678&lt;/P&gt;
&lt;P&gt;0204 123 1234&lt;/P&gt;
&lt;P&gt;021 123 45678&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Depends who you ask if they split the last digits equally, by twos, by three then the rest, etc. And the prefixes relate to the cell carrier, but some of them are 3 digits and some are 4 digits. Really confusing! But I always enter country code now for US numbers, so at least your check will help us internationals to correctly type a US phone number. &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 22 Dec 2020 21:14:43 GMT</pubDate>
    <dc:creator>AllisonKennedy</dc:creator>
    <dc:date>2020-12-22T21:14:43Z</dc:date>
    <item>
      <title>Phone Number Verifier</title>
      <link>https://community.fabric.microsoft.com/t5/Quick-Measures-Gallery/Phone-Number-Verifier/m-p/1554774#M647</link>
      <description>&lt;P&gt;This one verifies that a phone number is in the proper format: xxx-xxx-xxxx&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Phone Number Verifier = 
    VAR __ValidLen = 12
    VAR __Sep = "-"
    VAR __PhoneNumber = MAX([Phone#])
    VAR __First3 = LEFT(__PhoneNumber,3)
    VAR __FirstSep = MID(__PhoneNumber,4,1)
    VAR __Second3 = MID(__PhoneNumber,5,3)
    VAR __SecondSep = MID(__PhoneNumber,8,1)
    VAR __Third4 = RIGHT(__PhoneNumber,4)
RETURN
    SWITCH(TRUE(),
        NOT(ISERROR(__First3+0)) &amp;amp;&amp;amp; LEN(__First3) = 3 &amp;amp;&amp;amp; NOT(CONTAINSSTRING(__First3,"-")) &amp;amp;&amp;amp; 
        NOT(ISERROR(__Second3+0)) &amp;amp;&amp;amp; LEN(__Second3)=3 &amp;amp;&amp;amp; NOT(CONTAINSSTRING(__Second3,"-")) &amp;amp;&amp;amp; 
        NOT(ISERROR(__Third4+0)) &amp;amp;&amp;amp; LEN(__Third4) = 4 &amp;amp;&amp;amp; NOT(CONTAINSSTRING(__Third4,"-")) &amp;amp;&amp;amp; 
         __FirstSep = __Sep &amp;amp;&amp;amp; 
        __SecondSep = __Sep &amp;amp;&amp;amp;
        LEN(__PhoneNumber) = __ValidLen,
        TRUE(),
        FALSE()
    )&lt;/LI-CODE&gt;
&lt;P&gt;Fixed the above to include overall length validation per&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="227497" data-lia-user-login="AllisonKennedy" class="lia-mention lia-mention-user"&gt;AllisonKennedy&lt;/a&gt;&amp;nbsp;. Also, based on her suggestion, here is an international version:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;International Phone Number Verifier = 
    VAR __ValidLen = 14
    VAR __Sep = "-"
    VAR __PhoneNumber = MAX([Phone#])
    VAR __CountryCode = LEFT(__PhoneNumber,1)
    VAR __CountrySep = MID(__PhoneNumber,2,1)
    VAR __First3 = MID(__PhoneNumber,3,3)
    VAR __FirstSep = MID(__PhoneNumber,6,1)
    VAR __Second3 = MID(__PhoneNumber,7,3)
    VAR __SecondSep = MID(__PhoneNumber,10,1)
    VAR __Third4 = RIGHT(__PhoneNumber,4)
RETURN
    SWITCH(TRUE(),
        NOT(ISERROR(__CountryCode+0)) &amp;amp;&amp;amp; LEN(__CountryCode) = 1 &amp;amp;&amp;amp; NOT(CONTAINSSTRING(__CountryCode,"-")) &amp;amp;&amp;amp;     
        NOT(ISERROR(__First3+0)) &amp;amp;&amp;amp; LEN(__First3) = 3 &amp;amp;&amp;amp; NOT(CONTAINSSTRING(__First3,"-")) &amp;amp;&amp;amp; 
        NOT(ISERROR(__Second3+0)) &amp;amp;&amp;amp; LEN(__Second3)=3 &amp;amp;&amp;amp; NOT(CONTAINSSTRING(__Second3,"-")) &amp;amp;&amp;amp; 
        NOT(ISERROR(__Third4+0)) &amp;amp;&amp;amp; LEN(__Third4) = 4 &amp;amp;&amp;amp; NOT(CONTAINSSTRING(__Third4,"-")) &amp;amp;&amp;amp; 
         __FirstSep = __Sep &amp;amp;&amp;amp; __SecondSep = __Sep &amp;amp;&amp;amp; __CountrySep = __Sep &amp;amp;&amp;amp;
        LEN(__PhoneNumber) = __ValidLen,
        TRUE(),
        FALSE()
    )&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="reportid hidden"&gt;eyJrIjoiZTdhMjc5NmUtOTU1NC00YjYxLWFhZGMtZGQ2MTY4MTQ4MjJkIiwidCI6IjRhMDQyNzQzLTM3M2EtNDNkMi04MjdiLTAwM2Y0YzdiYTFlNSIsImMiOjN9&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 22 Dec 2020 16:11:29 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Quick-Measures-Gallery/Phone-Number-Verifier/m-p/1554774#M647</guid>
      <dc:creator>Greg_Deckler</dc:creator>
      <dc:date>2020-12-22T16:11:29Z</dc:date>
    </item>
    <item>
      <title>Re: Phone Number Verifier</title>
      <link>https://community.fabric.microsoft.com/t5/Quick-Measures-Gallery/Phone-Number-Verifier/m-p/1560132#M649</link>
      <description>&lt;P&gt;Pretty cool &lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="313" data-lia-user-login="Greg_Deckler" class="lia-mention lia-mention-user"&gt;Greg_Deckler&lt;/a&gt;&amp;nbsp;. I can't believe this doesn't exist yet! A silly question; why do you need to check the len() of the parts? Didn't you do that in creating the variables? Also, what if they add an extra digit to the end?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Now if you could create a check for NZ phone numbers you would be a genius (they don't have consistent formatting or length).&lt;/P&gt;</description>
      <pubDate>Fri, 18 Dec 2020 20:24:06 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Quick-Measures-Gallery/Phone-Number-Verifier/m-p/1560132#M649</guid>
      <dc:creator>AllisonKennedy</dc:creator>
      <dc:date>2020-12-18T20:24:06Z</dc:date>
    </item>
    <item>
      <title>Re: Phone Number Verifier</title>
      <link>https://community.fabric.microsoft.com/t5/Quick-Measures-Gallery/Phone-Number-Verifier/m-p/1562807#M650</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="227497" data-lia-user-login="AllisonKennedy" class="lia-mention lia-mention-user"&gt;AllisonKennedy&lt;/a&gt;&amp;nbsp;- I guess my thinking was to be thorough. I think it comes into play if the numbers are short. So, for example you grab the last 4 digits but there are only 3 digits to grab. I don't know, like most things I create, they can almost always be optimized! &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 21 Dec 2020 13:50:19 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Quick-Measures-Gallery/Phone-Number-Verifier/m-p/1562807#M650</guid>
      <dc:creator>Greg_Deckler</dc:creator>
      <dc:date>2020-12-21T13:50:19Z</dc:date>
    </item>
    <item>
      <title>Re: Phone Number Verifier</title>
      <link>https://community.fabric.microsoft.com/t5/Quick-Measures-Gallery/Phone-Number-Verifier/m-p/1563542#M651</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="313" data-lia-user-login="Greg_Deckler" class="lia-mention lia-mention-user"&gt;Greg_Deckler&lt;/a&gt;&amp;nbsp; You're like me, always over thinking and over engineering things. &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&amp;nbsp; Now you've got me too interested in this one, lol.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;OK, so your LEN check is required if they for example type:&amp;nbsp;&lt;/P&gt;
&lt;P&gt;800-588-230&lt;/P&gt;
&lt;P&gt;and miss the last digit (but everything else passes the check), so perhaps it is needed after all.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;I still have one scenario that needs fixed in your formula,&lt;/STRONG&gt; what if they type:&amp;nbsp;&lt;/P&gt;
&lt;P&gt;800-588-23001&lt;/P&gt;
&lt;P&gt;That's not a valid phone number, but passes all your checks.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also, being a non-US resident now, I'd love to see it handle this format:&lt;/P&gt;
&lt;P&gt;1-800-588-2300&lt;/P&gt;
&lt;P&gt;as valid (or even tell me three cases: "Valid No Country Code", "Valid with Country Code", "Invalid") but now I'm just getting picky.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 21 Dec 2020 21:41:30 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Quick-Measures-Gallery/Phone-Number-Verifier/m-p/1563542#M651</guid>
      <dc:creator>AllisonKennedy</dc:creator>
      <dc:date>2020-12-21T21:41:30Z</dc:date>
    </item>
    <item>
      <title>Re: Phone Number Verifier</title>
      <link>https://community.fabric.microsoft.com/t5/Quick-Measures-Gallery/Phone-Number-Verifier/m-p/1565570#M652</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="227497" data-lia-user-login="AllisonKennedy" class="lia-mention lia-mention-user"&gt;AllisonKennedy&lt;/a&gt;&amp;nbsp;- Love all of the suggestions and comments. I have updated this to include the fix for overall length and have included an International phone number verifier at least for United States and single digit country codes. Will have to think through being able to handle country codes of various lengths.&lt;/P&gt;</description>
      <pubDate>Tue, 22 Dec 2020 16:11:41 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Quick-Measures-Gallery/Phone-Number-Verifier/m-p/1565570#M652</guid>
      <dc:creator>Greg_Deckler</dc:creator>
      <dc:date>2020-12-22T16:11:41Z</dc:date>
    </item>
    <item>
      <title>Re: Phone Number Verifier</title>
      <link>https://community.fabric.microsoft.com/t5/Quick-Measures-Gallery/Phone-Number-Verifier/m-p/1565922#M653</link>
      <description>&lt;P&gt;Thanks&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="313" data-lia-user-login="Greg_Deckler" class="lia-mention lia-mention-user"&gt;Greg_Deckler&lt;/a&gt;&amp;nbsp;, it looks awesome now.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Good luck with the international country codes. As I mentioned, we have no fixed length for phone numbers in in NZ, nor is there a set way to display them. Mobile numbers can be for example:&amp;nbsp;&lt;/P&gt;
&lt;P&gt;021 123 4567&lt;/P&gt;
&lt;P&gt;027 1234 5678&lt;/P&gt;
&lt;P&gt;0204 123 1234&lt;/P&gt;
&lt;P&gt;021 123 45678&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Depends who you ask if they split the last digits equally, by twos, by three then the rest, etc. And the prefixes relate to the cell carrier, but some of them are 3 digits and some are 4 digits. Really confusing! But I always enter country code now for US numbers, so at least your check will help us internationals to correctly type a US phone number. &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 22 Dec 2020 21:14:43 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Quick-Measures-Gallery/Phone-Number-Verifier/m-p/1565922#M653</guid>
      <dc:creator>AllisonKennedy</dc:creator>
      <dc:date>2020-12-22T21:14:43Z</dc:date>
    </item>
  </channel>
</rss>

