<?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 Arcade Expression to hyperlink based on if / else if in ArcGIS Online Questions</title>
    <link>https://community.esri.com/t5/arcgis-online-questions/arcade-expression-to-hyperlink-based-on-if-else-if/m-p/1344572#M55573</link>
    <description>&lt;P&gt;Trying to hyperlink to a website (var URL below) if the cabinet status is Active, I would like to return "available, please click here to sign up for service" with the "click here" acting as a hyperlink. The code works below without, but when trying to link it is just showing the full HREF code.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="java"&gt;var intersectLayer = Intersects(FeatureSetByName($map, "HiLight Availability"), Buffer($feature, 0, 'feet'));
var zones = "";
var URL = "https://www.website.com";

if (Count(intersectLayer) &amp;gt; 0) {
   for (var f in intersectLayer) {
       if (f.CabinetStatus == 'Active') {
           zones = 'available';
           break;  // Exit the loop if an 'Active' status is found.
       } else if (f.CabinetStatus == 'Future') {
           zones = 'anticipated for future development';
           break;  // Exit the loop if a 'Future' status is found.
       } else if (f.CabinetStatus == 'Planned') {
           zones = 'planned';
           break;  // Exit the loop if a 'Planned' status is found.
       } else if (f.CabinetStatus == 'In Progress') {
           zones = 'in progress';
           break;  // Exit the loop if an 'In Progress' status is found.
       }
   }
} else {
   zones = 'not available at this address';
}

return lower(zones);&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 01 Nov 2023 18:15:25 GMT</pubDate>
    <dc:creator>Brian_McLeer</dc:creator>
    <dc:date>2023-11-01T18:15:25Z</dc:date>
    <item>
      <title>Arcade Expression to hyperlink based on if / else if</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/arcade-expression-to-hyperlink-based-on-if-else-if/m-p/1344572#M55573</link>
      <description>&lt;P&gt;Trying to hyperlink to a website (var URL below) if the cabinet status is Active, I would like to return "available, please click here to sign up for service" with the "click here" acting as a hyperlink. The code works below without, but when trying to link it is just showing the full HREF code.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="java"&gt;var intersectLayer = Intersects(FeatureSetByName($map, "HiLight Availability"), Buffer($feature, 0, 'feet'));
var zones = "";
var URL = "https://www.website.com";

if (Count(intersectLayer) &amp;gt; 0) {
   for (var f in intersectLayer) {
       if (f.CabinetStatus == 'Active') {
           zones = 'available';
           break;  // Exit the loop if an 'Active' status is found.
       } else if (f.CabinetStatus == 'Future') {
           zones = 'anticipated for future development';
           break;  // Exit the loop if a 'Future' status is found.
       } else if (f.CabinetStatus == 'Planned') {
           zones = 'planned';
           break;  // Exit the loop if a 'Planned' status is found.
       } else if (f.CabinetStatus == 'In Progress') {
           zones = 'in progress';
           break;  // Exit the loop if an 'In Progress' status is found.
       }
   }
} else {
   zones = 'not available at this address';
}

return lower(zones);&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 01 Nov 2023 18:15:25 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/arcade-expression-to-hyperlink-based-on-if-else-if/m-p/1344572#M55573</guid>
      <dc:creator>Brian_McLeer</dc:creator>
      <dc:date>2023-11-01T18:15:25Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade Expression to hyperlink based on if / else if</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/arcade-expression-to-hyperlink-based-on-if-else-if/m-p/1346394#M55719</link>
      <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/346604"&gt;@Brian_McLeer&lt;/a&gt;&amp;nbsp;- One way I have been able to do this by setting an attribute expression that is used with Text element in the pop-up.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Step 1 - Setting the attribute expression. Workout your conditional statements and the respective URLs.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="gis_KIWI4_0-1699306377229.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/85157i4A0C8FFCDB196D4F/image-size/medium?v=v2&amp;amp;px=400" role="button" title="gis_KIWI4_0-1699306377229.png" alt="gis_KIWI4_0-1699306377229.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;example - I have used the below condition in the URL Links expression.&lt;/P&gt;&lt;LI-CODE lang="c"&gt;if ($feature.Dorian_2019 == "YES")
{
  return "www.google.com"
}
else {
  return "www.youtube.com"
}&lt;/LI-CODE&gt;&lt;P&gt;&lt;BR /&gt;Step 2 - Add a text element to the pop-up.&amp;nbsp;&lt;BR /&gt;Insert the custom expression as a hyperlink.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="gis_KIWI4_1-1699306535348.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/85159iBFA62E73BFB210E5/image-size/medium?v=v2&amp;amp;px=400" role="button" title="gis_KIWI4_1-1699306535348.png" alt="gis_KIWI4_1-1699306535348.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="gis_KIWI4_2-1699306565656.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/85160iFDF210DACE0445D6/image-size/medium?v=v2&amp;amp;px=400" role="button" title="gis_KIWI4_2-1699306565656.png" alt="gis_KIWI4_2-1699306565656.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Results -&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="gis_KIWI4_3-1699306620306.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/85161iF5968FBFF416F4FE/image-size/medium?v=v2&amp;amp;px=400" role="button" title="gis_KIWI4_3-1699306620306.png" alt="gis_KIWI4_3-1699306620306.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="gis_KIWI4_4-1699306635899.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/85162iA4E527FBCBAD87A4/image-size/medium?v=v2&amp;amp;px=400" role="button" title="gis_KIWI4_4-1699306635899.png" alt="gis_KIWI4_4-1699306635899.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hope this helps &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 06 Nov 2023 21:37:36 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/arcade-expression-to-hyperlink-based-on-if-else-if/m-p/1346394#M55719</guid>
      <dc:creator>gis_KIWI4</dc:creator>
      <dc:date>2023-11-06T21:37:36Z</dc:date>
    </item>
  </channel>
</rss>

