<?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 Create multiple hyperlinks from a field of a comma separated string in ArcGIS Online Questions</title>
    <link>https://community.esri.com/t5/arcgis-online-questions/create-multiple-hyperlinks-from-a-field-of-a-comma/m-p/1100506#M42250</link>
    <description>&lt;P&gt;I have a feature layer on ArcGIS Online that contains a field of document names separated by commas (i.e. Easement1, Easement2, Easement3, etc.).&amp;nbsp; In the web map viewer pop-up, I would like to list each document name and hyperlink each to its respective document stored on sharepoint.&amp;nbsp; The pop-up element would look like something like below where W-0804 and W-0808 would each have a separate hyperlink to a document on a sharepoint site.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="RyanMiller6_0-1632250359018.png" style="width: 229px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/23555i7E2284CAF7BE19EA/image-dimensions/229x24?v=v2" width="229" height="24" role="button" title="RyanMiller6_0-1632250359018.png" alt="RyanMiller6_0-1632250359018.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;The link would looking something like this: &lt;A href="https://testsite.sharepoint.com/sites/ROW/Easements/{Agreements}.pdf" target="_blank"&gt;https://testsite.sharepoint.com/sites/ROW/Easements/{Agreements}.pdf&lt;/A&gt;&lt;/P&gt;&lt;P&gt;This kicker is that I would need the W-0804 and&amp;nbsp;W-0808 in the hyperlink in place of {Agreements}.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you in advance!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 21 Sep 2021 19:00:48 GMT</pubDate>
    <dc:creator>RyanMiller6</dc:creator>
    <dc:date>2021-09-21T19:00:48Z</dc:date>
    <item>
      <title>Create multiple hyperlinks from a field of a comma separated string</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/create-multiple-hyperlinks-from-a-field-of-a-comma/m-p/1100506#M42250</link>
      <description>&lt;P&gt;I have a feature layer on ArcGIS Online that contains a field of document names separated by commas (i.e. Easement1, Easement2, Easement3, etc.).&amp;nbsp; In the web map viewer pop-up, I would like to list each document name and hyperlink each to its respective document stored on sharepoint.&amp;nbsp; The pop-up element would look like something like below where W-0804 and W-0808 would each have a separate hyperlink to a document on a sharepoint site.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="RyanMiller6_0-1632250359018.png" style="width: 229px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/23555i7E2284CAF7BE19EA/image-dimensions/229x24?v=v2" width="229" height="24" role="button" title="RyanMiller6_0-1632250359018.png" alt="RyanMiller6_0-1632250359018.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;The link would looking something like this: &lt;A href="https://testsite.sharepoint.com/sites/ROW/Easements/{Agreements}.pdf" target="_blank"&gt;https://testsite.sharepoint.com/sites/ROW/Easements/{Agreements}.pdf&lt;/A&gt;&lt;/P&gt;&lt;P&gt;This kicker is that I would need the W-0804 and&amp;nbsp;W-0808 in the hyperlink in place of {Agreements}.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you in advance!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 21 Sep 2021 19:00:48 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/create-multiple-hyperlinks-from-a-field-of-a-comma/m-p/1100506#M42250</guid>
      <dc:creator>RyanMiller6</dc:creator>
      <dc:date>2021-09-21T19:00:48Z</dc:date>
    </item>
    <item>
      <title>Re: Create multiple hyperlinks from a field of a comma separated string</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/create-multiple-hyperlinks-from-a-field-of-a-comma/m-p/1100690#M42258</link>
      <description>&lt;P&gt;It is possible, but a bit cumbersome. The popup doesn't evaluate HTML code returned by an expression, so you will have to create multiple expressions like this:&lt;/P&gt;&lt;LI-CODE lang="c"&gt;// index of the agreement link you want to return
// 0 for first, 1 for second, ...
var return_index = 0
// split the agreements field
var agreements = Split($feature.Agreements, ", ")
// return early if you try to return an agreement that doesn't exist
if(return_index + 1 &amp;gt; Count(agreements)) {
  return ""
}
// return the specified agreement link
return "https://testsite.sharepoint.com/sites/ROW/Easements/" + agreements[return_index] + ".pdf"&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Copy that expression multiple times (if your maximum agreement number is 5, you should have 5 expressions) and change the return_index. You shoulb be able to show the links in the popup's attribute table.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If you want to get fancy, you can create expressions for the agreement names, too:&lt;/P&gt;&lt;LI-CODE lang="c"&gt;// index of the agreement name you want to return
// 0 for first, 1 for second, ...
var return_index = 0
// split the agreements field
var agreements = Split($feature.Agreements, ", ")
// return early if you try to return an agreement that doesn't exist
if(return_index + 1 &amp;gt; Count(agreements)) {
  return ""
}
// return the specified agreement link
var sep = IIF(return_index == 0, "", ", ")
return sep + agreements[return_index]&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Then you can create your example from above in the popup's HTML code:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Agreements: &amp;lt;a href="{expression/link1}"&amp;gt;{expression/name1}&amp;lt;/a&amp;gt;&amp;lt;a href="{expression/link2}"&amp;gt;{expression/name2}&amp;lt;/a&amp;gt;&amp;lt;a href="{expression/link3}"&amp;gt;{expression/name3}&amp;lt;/a&amp;gt;&amp;lt;a href="{expression/link4}"&amp;gt;{expression/name4}&amp;lt;/a&amp;gt;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 22 Sep 2021 08:01:51 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/create-multiple-hyperlinks-from-a-field-of-a-comma/m-p/1100690#M42258</guid>
      <dc:creator>JohannesLindner</dc:creator>
      <dc:date>2021-09-22T08:01:51Z</dc:date>
    </item>
  </channel>
</rss>

