<?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>question Re: Phone number fields in ITSM forum</title>
    <link>https://www.servicenow.com/community/itsm-forum/phone-number-fields/m-p/2686017#M504108</link>
    <description>&lt;P&gt;Thanks Brad, that worked !&lt;/P&gt;</description>
    <pubDate>Thu, 28 Sep 2023 14:56:36 GMT</pubDate>
    <dc:creator>George Scholl</dc:creator>
    <dc:date>2023-09-28T14:56:36Z</dc:date>
    <item>
      <title>Phone number fields</title>
      <link>https://www.servicenow.com/community/itsm-forum/phone-number-fields/m-p/2685990#M504105</link>
      <description>&lt;P&gt;Pretty simple question, but it has me stumped.&amp;nbsp; I need to move a user's phone number to a single line text variable.&amp;nbsp; How do I do that ?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;g_form.setValue('telephone', usr.phone); &amp;nbsp;doesn't work. &amp;nbsp;Seems like have to do with the users phone number field is set up a 'phone number' and there is no variable type for phone number.&amp;nbsp; &amp;nbsp;I have location working fine, &amp;nbsp;g_form.setValue('location', usr.location);&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 28 Sep 2023 14:50:20 GMT</pubDate>
      <guid>https://www.servicenow.com/community/itsm-forum/phone-number-fields/m-p/2685990#M504105</guid>
      <dc:creator>George Scholl</dc:creator>
      <dc:date>2023-09-28T14:50:20Z</dc:date>
    </item>
    <item>
      <title>Re: Phone number fields</title>
      <link>https://www.servicenow.com/community/itsm-forum/phone-number-fields/m-p/2686010#M504107</link>
      <description>&lt;P&gt;Have you tried forcing it to a string?&lt;/P&gt;
&lt;LI-CODE lang="javascript"&gt;g_form.setValue('telephone', usr.phone.toString());&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 28 Sep 2023 14:53:17 GMT</pubDate>
      <guid>https://www.servicenow.com/community/itsm-forum/phone-number-fields/m-p/2686010#M504107</guid>
      <dc:creator>Brad Bowman</dc:creator>
      <dc:date>2023-09-28T14:53:17Z</dc:date>
    </item>
    <item>
      <title>Re: Phone number fields</title>
      <link>https://www.servicenow.com/community/itsm-forum/phone-number-fields/m-p/2686017#M504108</link>
      <description>&lt;P&gt;Thanks Brad, that worked !&lt;/P&gt;</description>
      <pubDate>Thu, 28 Sep 2023 14:56:36 GMT</pubDate>
      <guid>https://www.servicenow.com/community/itsm-forum/phone-number-fields/m-p/2686017#M504108</guid>
      <dc:creator>George Scholl</dc:creator>
      <dc:date>2023-09-28T14:56:36Z</dc:date>
    </item>
    <item>
      <title>Re: Phone number fields</title>
      <link>https://www.servicenow.com/community/itsm-forum/phone-number-fields/m-p/2686184#M504116</link>
      <description>&lt;P&gt;You are welcome!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="comic sans ms,sans-serif" size="2"&gt;Connect with me &lt;A href="https://www.linkedin.com/in/brad-bowman-321b1567/" target="_blank" rel="noopener"&gt;https://www.linkedin.com/in/brad-bowman-321b1567/&lt;/A&gt;&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 28 Sep 2023 16:55:23 GMT</pubDate>
      <guid>https://www.servicenow.com/community/itsm-forum/phone-number-fields/m-p/2686184#M504116</guid>
      <dc:creator>Brad Bowman</dc:creator>
      <dc:date>2023-09-28T16:55:23Z</dc:date>
    </item>
    <item>
      <title>Re: Phone number fields</title>
      <link>https://www.servicenow.com/community/itsm-forum/phone-number-fields/m-p/3190132#M536344</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Since the phone number field in ServiceNow (or similar platforms) is set up as a "phone number" type, it's not just a simple text field and might have some additional formatting or validation that prevents g_form.setValue('telephone', usr.phone) from working as expected.&lt;/P&gt;&lt;P&gt;To move the phone number to a single-line text variable, you can try converting the phone number value into a string and removing any non-numeric characters (like parentheses or hyphens) before setting it to the text field. Here’s how you could do it:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;javascript&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;SPAN class=""&gt;Copy&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;SPAN&gt;&lt;SPAN class=""&gt;var&lt;/SPAN&gt; phone = usr.&lt;SPAN class=""&gt;phone&lt;/SPAN&gt;.&lt;SPAN class=""&gt;replace&lt;/SPAN&gt;(&lt;SPAN class=""&gt;/\D/g&lt;/SPAN&gt;, &lt;SPAN class=""&gt;''&lt;/SPAN&gt;); &lt;SPAN class=""&gt;// This will remove non-numeric characters&lt;/SPAN&gt; g_form.&lt;SPAN class=""&gt;setValue&lt;/SPAN&gt;(&lt;SPAN class=""&gt;'telephone'&lt;/SPAN&gt;, phone); &lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;PRE&gt;&amp;nbsp;&lt;/PRE&gt;&lt;P&gt;This way, you'll store the &lt;A href="https://www.acepeak.ai/virtual-number/" target="_self"&gt;phone number&lt;/A&gt; in a plain format without any special characters, which should allow it to work with a single-line text field.&lt;/P&gt;</description>
      <pubDate>Thu, 27 Feb 2025 07:41:11 GMT</pubDate>
      <guid>https://www.servicenow.com/community/itsm-forum/phone-number-fields/m-p/3190132#M536344</guid>
      <dc:creator>khanariyan</dc:creator>
      <dc:date>2025-02-27T07:41:11Z</dc:date>
    </item>
  </channel>
</rss>

