<?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 Re: Return a url based on a feature attribute in pop-up using Arcade? in ArcGIS Online Questions</title>
    <link>https://community.esri.com/t5/arcgis-online-questions/return-a-url-based-on-a-feature-attribute-in-pop/m-p/1237066#M49129</link>
    <description>&lt;P&gt;Hi again&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/501392"&gt;@wayfaringrob&lt;/a&gt;, I added the default value to the end of the expression and tested with no error.&lt;/P&gt;&lt;LI-CODE lang="c"&gt;var week = $feature.Week
decode(week, "Week 1", "https://www.ashburtondc.govt.nz/?a=57072", "Week 2", "https://www.ashburtondc.govt.nz/?a=57073", default)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The pop-up has recognised the word "here" as a hyperlink in the pop-up however it does not navigate to anywhere/can't be clicked. Am I missing something here? Thanks!&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Hayley_0-1669935969983.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/57423i89FD82BBF0BD44B3/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Hayley_0-1669935969983.png" alt="Hayley_0-1669935969983.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 01 Dec 2022 23:06:18 GMT</pubDate>
    <dc:creator>Hayley</dc:creator>
    <dc:date>2022-12-01T23:06:18Z</dc:date>
    <item>
      <title>Return a url based on a feature attribute in pop-up using Arcade?</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/return-a-url-based-on-a-feature-attribute-in-pop/m-p/1237039#M49126</link>
      <description>&lt;P&gt;I am trying to embed a URL into my pop-ups for a rubbish collection map.&amp;nbsp;&lt;/P&gt;&lt;P&gt;If the collection week of a boundary is week one, I want the URL to go to the week one page.&amp;nbsp;&lt;/P&gt;&lt;P&gt;If the collection week of a boundary is week two, I want the URL to go to the week two page.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I would like the URL to be embed into the word "here" in the pop-up as seen below:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Hayley_0-1669932003006.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/57413iDC2B479E8532D037/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Hayley_0-1669932003006.png" alt="Hayley_0-1669932003006.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;What expression is needed to pass through the correct URL for each pop-up? I have started with what I have below but am aware URLs need to be formatted in a certain way. Any pointers much appreciated!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="c"&gt;if ($feature.Week == "Week 1") {
    return "https://www.ashburtondc.govt.nz/?a=57072"
}

if ($feature.Week == "Week 2") {
    return "https://www.ashburtondc.govt.nz/?a=57073"
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 01 Dec 2022 22:03:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/return-a-url-based-on-a-feature-attribute-in-pop/m-p/1237039#M49126</guid>
      <dc:creator>Hayley</dc:creator>
      <dc:date>2022-12-01T22:03:04Z</dc:date>
    </item>
    <item>
      <title>Re: Return a url based on a feature attribute in pop-up using Arcade?</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/return-a-url-based-on-a-feature-attribute-in-pop/m-p/1237054#M49127</link>
      <description>&lt;P&gt;You'll want to add the Arcade as an attribute expression, and then point the hyperlink to that expression. It looks like you're using Map Viewer Classic, so that button is here:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="rburke_3-1669933256854.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/57420iA58DCDBA7DE2D46C/image-size/medium?v=v2&amp;amp;px=400" role="button" title="rburke_3-1669933256854.png" alt="rburke_3-1669933256854.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Once you're there, try adding this expression:&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;var week = $feature.Week
decode(week, "Week 1", "https://www.ashburtondc.govt.nz/?a=57072", "Week 2", "https://www.ashburtondc.govt.nz/?a=57073")&lt;/LI-CODE&gt;&lt;P&gt;Then, with "here" selected in your popup configuration, click Link and enter the name of your attribute expression in brackets, like this:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="rburke_4-1669933401103.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/57421iAF51139B8A62AC9D/image-size/medium?v=v2&amp;amp;px=400" role="button" title="rburke_4-1669933401103.png" alt="rburke_4-1669933401103.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Click 'Update.'&lt;/P&gt;</description>
      <pubDate>Thu, 01 Dec 2022 22:27:03 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/return-a-url-based-on-a-feature-attribute-in-pop/m-p/1237054#M49127</guid>
      <dc:creator>wayfaringrob</dc:creator>
      <dc:date>2022-12-01T22:27:03Z</dc:date>
    </item>
    <item>
      <title>Re: Return a url based on a feature attribute in pop-up using Arcade?</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/return-a-url-based-on-a-feature-attribute-in-pop/m-p/1237064#M49128</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/501392"&gt;@wayfaringrob&lt;/a&gt;&amp;nbsp;thanks for your help!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have created that as a new expression however am getting the error "&lt;SPAN class=""&gt;Execution Error:&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;Must have a default value result."&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Am I missing something here? Thanks!&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 01 Dec 2022 23:00:57 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/return-a-url-based-on-a-feature-attribute-in-pop/m-p/1237064#M49128</guid>
      <dc:creator>Hayley</dc:creator>
      <dc:date>2022-12-01T23:00:57Z</dc:date>
    </item>
    <item>
      <title>Re: Return a url based on a feature attribute in pop-up using Arcade?</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/return-a-url-based-on-a-feature-attribute-in-pop/m-p/1237066#M49129</link>
      <description>&lt;P&gt;Hi again&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/501392"&gt;@wayfaringrob&lt;/a&gt;, I added the default value to the end of the expression and tested with no error.&lt;/P&gt;&lt;LI-CODE lang="c"&gt;var week = $feature.Week
decode(week, "Week 1", "https://www.ashburtondc.govt.nz/?a=57072", "Week 2", "https://www.ashburtondc.govt.nz/?a=57073", default)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The pop-up has recognised the word "here" as a hyperlink in the pop-up however it does not navigate to anywhere/can't be clicked. Am I missing something here? Thanks!&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Hayley_0-1669935969983.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/57423i89FD82BBF0BD44B3/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Hayley_0-1669935969983.png" alt="Hayley_0-1669935969983.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 01 Dec 2022 23:06:18 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/return-a-url-based-on-a-feature-attribute-in-pop/m-p/1237066#M49129</guid>
      <dc:creator>Hayley</dc:creator>
      <dc:date>2022-12-01T23:06:18Z</dc:date>
    </item>
    <item>
      <title>Re: Return a url based on a feature attribute in pop-up using Arcade?</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/return-a-url-based-on-a-feature-attribute-in-pop/m-p/1237104#M49132</link>
      <description>&lt;P&gt;I found another way around it, using the expression below:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="c"&gt;var calendarone = "https://www.ashburtondc.govt.nz/?a=57072"
var calendartwo = "https://www.ashburtondc.govt.nz/?a=57073"

if ($feature.Week == 'Week 1') {
    return calendarone
}
else {
    return calendartwo
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Hayley_0-1669949320517.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/57437i02DC4D274AAE4FFF/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Hayley_0-1669949320517.png" alt="Hayley_0-1669949320517.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 02 Dec 2022 02:48:47 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/return-a-url-based-on-a-feature-attribute-in-pop/m-p/1237104#M49132</guid>
      <dc:creator>Hayley</dc:creator>
      <dc:date>2022-12-02T02:48:47Z</dc:date>
    </item>
    <item>
      <title>Re: Return a url based on a feature attribute in pop-up using Arcade?</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/return-a-url-based-on-a-feature-attribute-in-pop/m-p/1237224#M49135</link>
      <description>&lt;P&gt;Nice! Yeah, the Arcade documentation said the default portion was optional so I'm not sure why it didn't work that way.&lt;/P&gt;</description>
      <pubDate>Fri, 02 Dec 2022 15:00:35 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/return-a-url-based-on-a-feature-attribute-in-pop/m-p/1237224#M49135</guid>
      <dc:creator>wayfaringrob</dc:creator>
      <dc:date>2022-12-02T15:00:35Z</dc:date>
    </item>
    <item>
      <title>Re: Return a url based on a feature attribute in pop-up using Arcade?</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/return-a-url-based-on-a-feature-attribute-in-pop/m-p/1237629#M49157</link>
      <description>&lt;P&gt;Thanks for your help&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/501392"&gt;@wayfaringrob&lt;/a&gt;&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 04 Dec 2022 19:44:26 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/return-a-url-based-on-a-feature-attribute-in-pop/m-p/1237629#M49157</guid>
      <dc:creator>Hayley</dc:creator>
      <dc:date>2022-12-04T19:44:26Z</dc:date>
    </item>
  </channel>
</rss>

