<?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 How to insert multiple URL's in a single field? in Developer forum</title>
    <link>https://www.servicenow.com/community/developer-forum/how-to-insert-multiple-url-s-in-a-single-field/m-p/1504240#M161166</link>
    <description>&lt;P&gt;Hello All,&lt;BR /&gt;&lt;BR /&gt;I have a requirement where we have to provide multiple links in a single field.User should have the freedom of clicking on any link and opening in a new tab/window.Currently in out of box functionality of SNC,they have provided a URL field which works as single link and not multiple.&lt;BR /&gt;&lt;BR /&gt;Can someone please provide some assistance on this?&lt;BR /&gt;&lt;BR /&gt;Thanks.&lt;/P&gt;</description>
    <pubDate>Tue, 05 Jul 2011 09:00:57 GMT</pubDate>
    <dc:creator>User150433</dc:creator>
    <dc:date>2011-07-05T09:00:57Z</dc:date>
    <item>
      <title>How to insert multiple URL's in a single field?</title>
      <link>https://www.servicenow.com/community/developer-forum/how-to-insert-multiple-url-s-in-a-single-field/m-p/1504240#M161166</link>
      <description>&lt;P&gt;Hello All,&lt;BR /&gt;&lt;BR /&gt;I have a requirement where we have to provide multiple links in a single field.User should have the freedom of clicking on any link and opening in a new tab/window.Currently in out of box functionality of SNC,they have provided a URL field which works as single link and not multiple.&lt;BR /&gt;&lt;BR /&gt;Can someone please provide some assistance on this?&lt;BR /&gt;&lt;BR /&gt;Thanks.&lt;/P&gt;</description>
      <pubDate>Tue, 05 Jul 2011 09:00:57 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/how-to-insert-multiple-url-s-in-a-single-field/m-p/1504240#M161166</guid>
      <dc:creator>User150433</dc:creator>
      <dc:date>2011-07-05T09:00:57Z</dc:date>
    </item>
    <item>
      <title>Re: How to insert multiple URL's in a single field?</title>
      <link>https://www.servicenow.com/community/developer-forum/how-to-insert-multiple-url-s-in-a-single-field/m-p/1504241#M161167</link>
      <description>&lt;P&gt;I think an HTML field is going to be as close as you can get. Without creating your own new unsupported field type from the ground up, and I doubt anything like that has ever been documented. Or attempted in any real sense.&lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 05 Jul 2011 14:22:00 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/how-to-insert-multiple-url-s-in-a-single-field/m-p/1504241#M161167</guid>
      <dc:creator>CapaJ</dc:creator>
      <dc:date>2011-07-05T14:22:00Z</dc:date>
    </item>
    <item>
      <title>Re: How to insert multiple URL's in a single field?</title>
      <link>https://www.servicenow.com/community/developer-forum/how-to-insert-multiple-url-s-in-a-single-field/m-p/1504242#M161168</link>
      <description>&lt;P&gt;Hi Amit,&lt;BR /&gt;&lt;BR /&gt;I have same requirement where user have to provide multiple links in a single URL field. Did you get any luck on this? If yes could you please share the same. Really appreciate your help.&lt;BR /&gt;&lt;BR /&gt;Thanks&lt;BR /&gt;Nataraj&lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Mon, 23 Dec 2013 11:17:25 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/how-to-insert-multiple-url-s-in-a-single-field/m-p/1504242#M161168</guid>
      <dc:creator>nataraj1</dc:creator>
      <dc:date>2013-12-23T11:17:25Z</dc:date>
    </item>
    <item>
      <title>Re: How to insert multiple URL's in a single field?</title>
      <link>https://www.servicenow.com/community/developer-forum/how-to-insert-multiple-url-s-in-a-single-field/m-p/1504243#M161169</link>
      <description>&lt;P&gt;I would suggest creating a new table to hold your links. Each record would have a reference field back to your original form, and a URL field.&lt;BR /&gt;&lt;BR /&gt;Then, add this new table to your form as an embedded related list. Then the user can add one or many URLs to the form, and they would each appear in their own line.&lt;BR /&gt;&lt;BR /&gt;Cheers,&lt;BR /&gt; Geoff.&lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Mon, 23 Dec 2013 17:50:57 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/how-to-insert-multiple-url-s-in-a-single-field/m-p/1504243#M161169</guid>
      <dc:creator>geoffcox</dc:creator>
      <dc:date>2013-12-23T17:50:57Z</dc:date>
    </item>
    <item>
      <title>Re: How to insert multiple URL's in a single field?</title>
      <link>https://www.servicenow.com/community/developer-forum/how-to-insert-multiple-url-s-in-a-single-field/m-p/1504244#M161170</link>
      <description>&lt;P&gt;I have done exactly this on &amp;nbsp; one of my forms but that field is pre populated and not filled by user at the run time. &lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;I have the URLs in an array and &amp;nbsp; this is how i save them on a text field. This is a server side code&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;var array = ////HOLDS URL&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;for(var i = 0;i&amp;lt;array.length;i++)&lt;/P&gt;&lt;BR /&gt;&lt;P&gt; &amp;nbsp; {&lt;/P&gt;&lt;BR /&gt;&lt;P&gt; &amp;nbsp; task.multiple_url_field += "&amp;lt;a href='"+array[i]+"' target='_new'&amp;gt; "+array[i]+"&amp;lt;/a&amp;gt;;"+" "; &amp;nbsp; &amp;nbsp; //target can be manipulated &lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;}&lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 21 Jan 2015 15:46:22 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/how-to-insert-multiple-url-s-in-a-single-field/m-p/1504244#M161170</guid>
      <dc:creator>Anurag Tripathi</dc:creator>
      <dc:date>2015-01-21T15:46:22Z</dc:date>
    </item>
    <item>
      <title>Re: How to insert multiple URL's in a single field?</title>
      <link>https://www.servicenow.com/community/developer-forum/how-to-insert-multiple-url-s-in-a-single-field/m-p/1504245#M161171</link>
      <description>&lt;P&gt;Is that a URL or HTML field ?&lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 21 Jan 2015 15:49:35 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/how-to-insert-multiple-url-s-in-a-single-field/m-p/1504245#M161171</guid>
      <dc:creator>poyntzj</dc:creator>
      <dc:date>2015-01-21T15:49:35Z</dc:date>
    </item>
    <item>
      <title>Re: How to insert multiple URL's in a single field?</title>
      <link>https://www.servicenow.com/community/developer-forum/how-to-insert-multiple-url-s-in-a-single-field/m-p/1504246#M161172</link>
      <description>&lt;P&gt;HTML&lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 21 Jan 2015 15:54:50 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/how-to-insert-multiple-url-s-in-a-single-field/m-p/1504246#M161172</guid>
      <dc:creator>Anurag Tripathi</dc:creator>
      <dc:date>2015-01-21T15:54:50Z</dc:date>
    </item>
    <item>
      <title>Re: How to insert multiple URL's in a single field?</title>
      <link>https://www.servicenow.com/community/developer-forum/how-to-insert-multiple-url-s-in-a-single-field/m-p/1504247#M161173</link>
      <description>&lt;P&gt;If you want to avoid using an HTML field you can do it in two ways:&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;- First one is by having a choice field with different choices (and its values the url) and a UIA that popups the value of the choice field.&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;- The other one is by DOM manipulation, onLoad script, the code is a bit shoddy but works for me:&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;-------------------------------------------------------------------------------------------------------------------&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;var originalOuterHtml;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;var counter = 0;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;var links;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;var originalId;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;function onLoad() {&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt; &amp;nbsp; var varname = 'u_testing'; // This is the only thing you need to change - field name&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt; &amp;nbsp; var el = g_form.getElement(varname);&lt;/P&gt;&lt;BR /&gt;&lt;P&gt; &amp;nbsp; originalOuterHtml = el.outerHTML;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt; &amp;nbsp; originalId = el.id;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt; &amp;nbsp; links = g_form.getValue(varname).split("\n")&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt; &amp;nbsp; changeLabelClickEvent(varname);&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;}&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;function changeLabelClickEvent(varname){&lt;/P&gt;&lt;BR /&gt;&lt;P&gt; &amp;nbsp; var label = g_form.getLabel(varname);&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt; &amp;nbsp; var pattern = /onclick="(.*);"/;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt; &amp;nbsp; var found = pattern.exec(label.outerHTML);&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt; &amp;nbsp; if(found[0]){&lt;/P&gt;&lt;BR /&gt;&lt;P&gt; &amp;nbsp; var newOnclick = "onclick=\"return changeElementType('"+varname+"');\"";&lt;/P&gt;&lt;BR /&gt;&lt;P&gt; &amp;nbsp; label.outerHTML = label.outerHTML.replace(found[0],newOnclick);&lt;/P&gt;&lt;BR /&gt;&lt;P&gt; &amp;nbsp; }&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;}&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;function changeElementType(varname){&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt; &amp;nbsp; var pair = counter % 2;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt; &amp;nbsp; var el = document.getElementById(originalId);&lt;/P&gt;&lt;BR /&gt;&lt;P&gt; &amp;nbsp; counter++;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt; &amp;nbsp; if(pair == 0){&lt;/P&gt;&lt;BR /&gt;&lt;P&gt; &amp;nbsp; var newOuterHtml = "&amp;lt;div id='"+originalId+"'&amp;gt;";&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt; &amp;nbsp; for(var i=0; i&amp;lt;links.length; i++){&lt;/P&gt;&lt;BR /&gt;&lt;P&gt; &amp;nbsp; newOuterHtml += '&amp;lt;a href="'+links[i]+'"&amp;gt;'+links[i]+'&amp;lt;/a&amp;gt;&amp;lt;br&amp;gt;';&lt;/P&gt;&lt;BR /&gt;&lt;P&gt; &amp;nbsp; }&lt;/P&gt;&lt;BR /&gt;&lt;P&gt; &amp;nbsp; newOuterHtml += "&amp;lt;/div&amp;gt;";&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt; &amp;nbsp; el.outerHTML = newOuterHtml;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt; &amp;nbsp; }else{&lt;/P&gt;&lt;BR /&gt;&lt;P&gt; &amp;nbsp; el.outerHTML = originalOuterHtml;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt; &amp;nbsp; changeLabelClickEvent(varname);&lt;/P&gt;&lt;BR /&gt;&lt;P&gt; &amp;nbsp; }&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;}&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;-------------------------------------------------------------------------------------------------------------------&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;How it works? you have a textarea field called 'u_testing' (in my example) and there you write your urls. By clicking on the field label the field will change into the urls you wrote on the textArea. By click label again it will change back to the original textArea field allowing you to modify the urls.&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 22 Jan 2015 09:56:02 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/how-to-insert-multiple-url-s-in-a-single-field/m-p/1504247#M161173</guid>
      <dc:creator>sergioap</dc:creator>
      <dc:date>2015-01-22T09:56:02Z</dc:date>
    </item>
    <item>
      <title>Re: How to insert multiple URL's in a single field?</title>
      <link>https://www.servicenow.com/community/developer-forum/how-to-insert-multiple-url-s-in-a-single-field/m-p/1504248#M161174</link>
      <description>&lt;P&gt;Hi Sergioap,&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;I tried seems all cool but i got stuck in one place when i am putting all url and saving the form then its considering all url as a single url .&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;Can you suggest , how they will be appear as a separate URL ?&lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 01 Dec 2016 21:48:57 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/how-to-insert-multiple-url-s-in-a-single-field/m-p/1504248#M161174</guid>
      <dc:creator>gomsi</dc:creator>
      <dc:date>2016-12-01T21:48:57Z</dc:date>
    </item>
    <item>
      <title>Re: How to insert multiple URL's in a single field?</title>
      <link>https://www.servicenow.com/community/developer-forum/how-to-insert-multiple-url-s-in-a-single-field/m-p/1504249#M161175</link>
      <description>&lt;P&gt;I am facing the same issue. Did you find solution for it?&lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 24 Oct 2017 13:08:40 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/how-to-insert-multiple-url-s-in-a-single-field/m-p/1504249#M161175</guid>
      <dc:creator>aartiaushal</dc:creator>
      <dc:date>2017-10-24T13:08:40Z</dc:date>
    </item>
    <item>
      <title>Re: How to insert multiple URL's in a single field?</title>
      <link>https://www.servicenow.com/community/developer-forum/how-to-insert-multiple-url-s-in-a-single-field/m-p/1504250#M161176</link>
      <description>&lt;P&gt;Hey I found it.&lt;BR /&gt;you should use a String field and every URL should be on a new line.Once done you will not get the URL added as a single line.&lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 24 Oct 2017 13:12:39 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/how-to-insert-multiple-url-s-in-a-single-field/m-p/1504250#M161176</guid>
      <dc:creator>aartiaushal</dc:creator>
      <dc:date>2017-10-24T13:12:39Z</dc:date>
    </item>
  </channel>
</rss>

