<?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 Creating link with hyperlink in popup field based on a condition in ArcGIS Online Questions</title>
    <link>https://community.esri.com/t5/arcgis-online-questions/creating-link-with-hyperlink-in-popup-field-based/m-p/1237549#M49153</link>
    <description>&lt;P&gt;I have a point feature class named Shelters. There is a field named "SHELTERPREPLAN" in the default pop up. This field has Yes and No values.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am learning Arcade. I need to make a conditional popup where if SHELTERPREPLAN = Yes then the "Yes" would be a link to a hyperlink; If SHELTERPREPLAN = No, then no action would be taken.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I know that I need to use href somewhere maybe like this:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;&amp;lt;a&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class=""&gt;href&lt;/SPAN&gt;&lt;SPAN class=""&gt;=&lt;/SPAN&gt;&lt;SPAN class=""&gt;"myurl"&lt;/SPAN&gt;&lt;SPAN class=""&gt;&amp;gt;&lt;/SPAN&gt;&lt;SPAN class=""&gt;Yes&lt;/SPAN&gt;&lt;SPAN class=""&gt;&amp;lt;/a&amp;gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Here is the expression I have created, maybe someone out there can give me a little push in the right direction:&lt;/P&gt;&lt;P&gt;IIF($feature["SHELTERPREPLAN"]=="Yes", "myurl", "")&lt;/P&gt;&lt;P&gt;The above bit of code outputs the url in the SHELTERPREPLAN field. But what is the best way to add the href so the Yes becomes a link to the url?&lt;/P&gt;&lt;P&gt;I am using Map Viewer Classic or can use Map Viewer if this helps.&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sat, 03 Dec 2022 16:10:05 GMT</pubDate>
    <dc:creator>TimHayes3</dc:creator>
    <dc:date>2022-12-03T16:10:05Z</dc:date>
    <item>
      <title>Creating link with hyperlink in popup field based on a condition</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/creating-link-with-hyperlink-in-popup-field-based/m-p/1237549#M49153</link>
      <description>&lt;P&gt;I have a point feature class named Shelters. There is a field named "SHELTERPREPLAN" in the default pop up. This field has Yes and No values.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am learning Arcade. I need to make a conditional popup where if SHELTERPREPLAN = Yes then the "Yes" would be a link to a hyperlink; If SHELTERPREPLAN = No, then no action would be taken.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I know that I need to use href somewhere maybe like this:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;&amp;lt;a&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class=""&gt;href&lt;/SPAN&gt;&lt;SPAN class=""&gt;=&lt;/SPAN&gt;&lt;SPAN class=""&gt;"myurl"&lt;/SPAN&gt;&lt;SPAN class=""&gt;&amp;gt;&lt;/SPAN&gt;&lt;SPAN class=""&gt;Yes&lt;/SPAN&gt;&lt;SPAN class=""&gt;&amp;lt;/a&amp;gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Here is the expression I have created, maybe someone out there can give me a little push in the right direction:&lt;/P&gt;&lt;P&gt;IIF($feature["SHELTERPREPLAN"]=="Yes", "myurl", "")&lt;/P&gt;&lt;P&gt;The above bit of code outputs the url in the SHELTERPREPLAN field. But what is the best way to add the href so the Yes becomes a link to the url?&lt;/P&gt;&lt;P&gt;I am using Map Viewer Classic or can use Map Viewer if this helps.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 03 Dec 2022 16:10:05 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/creating-link-with-hyperlink-in-popup-field-based/m-p/1237549#M49153</guid>
      <dc:creator>TimHayes3</dc:creator>
      <dc:date>2022-12-03T16:10:05Z</dc:date>
    </item>
    <item>
      <title>Re: Creating link with hyperlink in popup field based on a condition</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/creating-link-with-hyperlink-in-popup-field-based/m-p/1237805#M49175</link>
      <description>&lt;P&gt;The code below will return the value in a field called myURL, with the display text as Yes. It will only show this if Shelter Plan is equal to Yes. Any other value will result in a blank.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I did this in Map Viewer, mainly because the Arcade editor is much easier to work with since it provides suggestions.&lt;/P&gt;&lt;LI-CODE lang="c"&gt;if ($feature.SHELTERPLAN == "Yes"){
  return { 
	  type : 'text', 
	  text : '&amp;lt;a href=' + $feature.myURL + '&amp;gt;Yes&amp;lt;/a&amp;gt;' //this property supports html tags 
  }  
}
&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 05 Dec 2022 15:36:27 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/creating-link-with-hyperlink-in-popup-field-based/m-p/1237805#M49175</guid>
      <dc:creator>DanielMiranda2</dc:creator>
      <dc:date>2022-12-05T15:36:27Z</dc:date>
    </item>
  </channel>
</rss>

