<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://www.infopathdev.com:443/utility/FeedStylesheets/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>Controls</title><link>https://www.infopathdev.com:443/forums/43.aspx</link><description> </description><dc:language>en</dc:language><generator>CommunityServer 2007 SP3 (Build: 31118.962)</generator><item><title>Re: Help and explaination of a format control on phone numbers?</title><link>https://www.infopathdev.com:443/forums/thread/98559.aspx</link><pubDate>Mon, 04 Aug 2014 14:29:17 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:98559</guid><dc:creator>rcl0404</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/98559.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=43&amp;PostID=98559</wfw:commentRss><description>&lt;p&gt;I need to be more specfic, as I&amp;#39;ve cleaned it up a bit, let&amp;#39;s go from here:&lt;/p&gt;&lt;p&gt;I unconditionally&amp;nbsp;translate ALL non-numbers to NULL, so (723)555-5566 becomes 7235555566 and 1+3456667788 becomes 13456667788 and so forth. So I can manipulate these fromcommon characters, I only need to account for international and local formats.&lt;/p&gt;&lt;p&gt;(for local) I am curious on how I would be able to make a rule to tell the field to put a hyphen after the first 3 numbers, then another after the first 6.&lt;/p&gt;&lt;p&gt;Then I would have a seperate rule for if the number has more than 10 digits using a format condition of &amp;gt;10 characters, (which would mean International), that would put a &amp;quot;+&amp;quot; after the first number then&amp;nbsp;put a hyphen after the first&amp;nbsp;5 numbers, then another after the first 8.&lt;/p&gt;&lt;p&gt;Thanks&lt;/p&gt;</description></item><item><title>Re: Help and explaination of a format control on phone numbers?</title><link>https://www.infopathdev.com:443/forums/thread/98530.aspx</link><pubDate>Mon, 04 Aug 2014 04:03:07 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:98530</guid><dc:creator>JenniferLindsay</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/98530.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=43&amp;PostID=98530</wfw:commentRss><description>&lt;p&gt;There is no single formula to translate all of these different formats.&amp;nbsp;What you want is a separate action&amp;nbsp;rule for each phone number format. Each rule will have a condition checking if the phone number is format X, and if it is then you will have a translate function to translate the phone number into your desired 10 numbers 2 hyphens format.&amp;nbsp; However, this requires that you know all of the different possible formats your database contains. If you don&amp;#39;t know all of the different formats, then the best you can do is put a validation rule on the field that will outline it with a dashed red line if it doesn&amp;#39;t match the correct format.&lt;/p&gt;&lt;p&gt;&amp;nbsp;Each formula is going to be a bit complex, so I&amp;#39;ll explain one of them and hopefully you can figure out how to come up with the rest.&lt;/p&gt;&lt;p&gt;&amp;nbsp;For the (123)456-7890 format:&lt;/p&gt;&lt;p&gt;First you want to compare the starting format with the desired format:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;div&gt;Starting: (\d\d\d)\d\d\d-\d\d\d\d&lt;/div&gt;&lt;/li&gt;&lt;li&gt;&lt;div&gt;Desired: \d\d\d-\d\d\d-\d\d\d\d&lt;/div&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;Looking at these two, you see that the starting one can be transformed into the desired one by removing the left parenthesis completely and by converting the right parenthesis into a dash. Each of these can be accomplished by using the translate function: &lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;div&gt;Remove left parenthesis: translate(Field,&amp;quot;(&amp;quot;,&amp;quot;&amp;quot;)&lt;/div&gt;&lt;/li&gt;&lt;li&gt;&lt;div&gt;Turn right parenthesis into dash: translate(Field,&amp;quot;)&amp;quot;,&amp;quot;-&amp;quot;)&lt;/div&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;Now just combine the two translate functions. The final rule is below:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;div&gt;Condition: Field - matches pattern - (\d\d\d)\d\d\d-\d\d\d\d&lt;/div&gt;&lt;/li&gt;&lt;li&gt;&lt;div&gt;Action: Field = translate(translate(Field,&amp;quot;(&amp;quot;,&amp;quot;&amp;quot;),&amp;quot;)&amp;quot;,&amp;quot;-&amp;quot;))&lt;/div&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;Hope that helps!&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description></item><item><title>Help and explaination of a format control on phone numbers?</title><link>https://www.infopathdev.com:443/forums/thread/98513.aspx</link><pubDate>Thu, 31 Jul 2014 15:41:20 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:98513</guid><dc:creator>rcl0404</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/98513.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=43&amp;PostID=98513</wfw:commentRss><description>&lt;p&gt;I&amp;#39;ve seen &amp;quot;copy and paste this&amp;quot; into the formula boxes to achieve different effect, but I&amp;#39;d like them explained a bit as well so I can change it if needed.&lt;/p&gt;&lt;p&gt;I recieve phone numbers in various formats from a database,&amp;nbsp;I want them in the 123-456-7890 format. I recieve them in (123)456-7890 1234567890 and others, including international 1+1234567890.&lt;/p&gt;&lt;p&gt;I want all of these into a 123-456-7890 format, 10 numbers&amp;nbsp;2 hyphens.&amp;nbsp;I am familiar with the translate and substring-after commands, not so much on combining them to achieve the desired effect.&lt;/p&gt;&lt;p&gt;please give me the formula, and break it down verbally to I can understand it.&lt;/p&gt;&lt;p&gt;Thanks&lt;/p&gt;</description></item></channel></rss>