<?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 URLs in List Data Expression in ArcGIS Dashboards Questions</title>
    <link>https://community.esri.com/t5/arcgis-dashboards-questions/urls-in-list-data-expression/m-p/1175935#M6328</link>
    <description>&lt;P&gt;Hi -&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am customizing a list within my Dashboard and running into some odd behavior I am hoping for some help with.&amp;nbsp;&lt;/P&gt;&lt;P&gt;My feature layer has a field "Project_Folder_URL" which leads off to a SharePoint site. I want this URL to appear, for records which have it, in my customized list as a link that says "View Project Files". This is where I run into issues. I have this variable in my data expression for the list:&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;var link = Iif(IsEmpty($datapoint["Project_Folder_URL"]), '', 'View Project Files');
return {
  textColor: '',
  backgroundColor: Iif($datapoint["Condition_ContMonitor"] =="Yes", '#3a0000', ''),
  separatorColor:'#',
  selectionColor: '#cccccc',
  selectionTextColor: '',
  attributes: {
    cardHeight: 'auto', // Set consistent height or use 'auto'
    cardBkgColor: '#ffff', // Choose a color such as rgba(150, 130, 110, 0.1),
    radius: '5px',
    value: $datapoint.DCR_File_Number,
    valueSizePx: 18,
    AppStatusIcon: AppStatusIcon,
    AppStatusTxt: $datapoint.Application_Status,
    title: Proper($datapoint.Lot_Address) + Proper($datapoint.ROW_Name) + ', ' + Proper($datapoint.Lot_Town) + Proper($datapoint.ROW_Town),
    titleFontSize: '14px',
    description: 'Request Type: ' + DomainName($datapoint,"Request_Type"),
    maxDescriptionLines: 1, // ( &amp;lt;integer&amp;gt; | none )
    project_url: link,
    footerColor: '#EFECE2',
    footerText: flexItems&lt;/LI-CODE&gt;&lt;P&gt;I return it in line 20.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Within my HTML, you can see this expression called here:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;&amp;lt;div style="-webkit-box-orient:vertical; -webkit-line-clamp:{expression/maxDescriptionLines1}; display:-webkit-box; font-size:12px; font-weight:200; margin-bottom:0.3rem; opacity:0.6; overflow:hidden; padding:0.3rem 0; text-overflow:ellipsis"&amp;gt;&amp;lt;a href="{expression/project_url}"&amp;gt;{expression/project_url}&amp;lt;/a&amp;gt;&amp;lt;/div&amp;gt;&lt;/LI-CODE&gt;&lt;P&gt;The list item looks great, however the URL being created in the list element is incorrect - it actually just changes the URL to that of the Dashboard for each item in the list.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="erica_tefft_0-1653057022273.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/41816i3C7239A68B5C72AE/image-size/medium?v=v2&amp;amp;px=400" role="button" title="erica_tefft_0-1653057022273.png" alt="erica_tefft_0-1653057022273.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;If I change my data expression (line 1 only - the return statement in line 20 remains the same)&amp;nbsp; to the following, then the link is correct and works.&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;var link = $datapoint["Project_Folder_URL"];&lt;/LI-CODE&gt;&lt;P&gt;The issue here is that this is what my list element looks like:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="erica_tefft_2-1653058153853.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/41820i4DB2A2F6965265E8/image-size/medium?v=v2&amp;amp;px=400" role="button" title="erica_tefft_2-1653058153853.png" alt="erica_tefft_2-1653058153853.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Help understanding why the Iif &amp;amp; IsEmpty statements return the Dashboard URL instead of my project URL would be appreciated.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 20 May 2022 14:49:31 GMT</pubDate>
    <dc:creator>erica_poisson</dc:creator>
    <dc:date>2022-05-20T14:49:31Z</dc:date>
    <item>
      <title>URLs in List Data Expression</title>
      <link>https://community.esri.com/t5/arcgis-dashboards-questions/urls-in-list-data-expression/m-p/1175935#M6328</link>
      <description>&lt;P&gt;Hi -&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am customizing a list within my Dashboard and running into some odd behavior I am hoping for some help with.&amp;nbsp;&lt;/P&gt;&lt;P&gt;My feature layer has a field "Project_Folder_URL" which leads off to a SharePoint site. I want this URL to appear, for records which have it, in my customized list as a link that says "View Project Files". This is where I run into issues. I have this variable in my data expression for the list:&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;var link = Iif(IsEmpty($datapoint["Project_Folder_URL"]), '', 'View Project Files');
return {
  textColor: '',
  backgroundColor: Iif($datapoint["Condition_ContMonitor"] =="Yes", '#3a0000', ''),
  separatorColor:'#',
  selectionColor: '#cccccc',
  selectionTextColor: '',
  attributes: {
    cardHeight: 'auto', // Set consistent height or use 'auto'
    cardBkgColor: '#ffff', // Choose a color such as rgba(150, 130, 110, 0.1),
    radius: '5px',
    value: $datapoint.DCR_File_Number,
    valueSizePx: 18,
    AppStatusIcon: AppStatusIcon,
    AppStatusTxt: $datapoint.Application_Status,
    title: Proper($datapoint.Lot_Address) + Proper($datapoint.ROW_Name) + ', ' + Proper($datapoint.Lot_Town) + Proper($datapoint.ROW_Town),
    titleFontSize: '14px',
    description: 'Request Type: ' + DomainName($datapoint,"Request_Type"),
    maxDescriptionLines: 1, // ( &amp;lt;integer&amp;gt; | none )
    project_url: link,
    footerColor: '#EFECE2',
    footerText: flexItems&lt;/LI-CODE&gt;&lt;P&gt;I return it in line 20.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Within my HTML, you can see this expression called here:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;&amp;lt;div style="-webkit-box-orient:vertical; -webkit-line-clamp:{expression/maxDescriptionLines1}; display:-webkit-box; font-size:12px; font-weight:200; margin-bottom:0.3rem; opacity:0.6; overflow:hidden; padding:0.3rem 0; text-overflow:ellipsis"&amp;gt;&amp;lt;a href="{expression/project_url}"&amp;gt;{expression/project_url}&amp;lt;/a&amp;gt;&amp;lt;/div&amp;gt;&lt;/LI-CODE&gt;&lt;P&gt;The list item looks great, however the URL being created in the list element is incorrect - it actually just changes the URL to that of the Dashboard for each item in the list.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="erica_tefft_0-1653057022273.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/41816i3C7239A68B5C72AE/image-size/medium?v=v2&amp;amp;px=400" role="button" title="erica_tefft_0-1653057022273.png" alt="erica_tefft_0-1653057022273.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;If I change my data expression (line 1 only - the return statement in line 20 remains the same)&amp;nbsp; to the following, then the link is correct and works.&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;var link = $datapoint["Project_Folder_URL"];&lt;/LI-CODE&gt;&lt;P&gt;The issue here is that this is what my list element looks like:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="erica_tefft_2-1653058153853.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/41820i4DB2A2F6965265E8/image-size/medium?v=v2&amp;amp;px=400" role="button" title="erica_tefft_2-1653058153853.png" alt="erica_tefft_2-1653058153853.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Help understanding why the Iif &amp;amp; IsEmpty statements return the Dashboard URL instead of my project URL would be appreciated.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 20 May 2022 14:49:31 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-dashboards-questions/urls-in-list-data-expression/m-p/1175935#M6328</guid>
      <dc:creator>erica_poisson</dc:creator>
      <dc:date>2022-05-20T14:49:31Z</dc:date>
    </item>
    <item>
      <title>Re: URLs in List Data Expression</title>
      <link>https://community.esri.com/t5/arcgis-dashboards-questions/urls-in-list-data-expression/m-p/1175943#M6329</link>
      <description>&lt;P&gt;If I'm understanding this right, your link object is using&amp;nbsp;&lt;STRONG&gt;{expression/project_url}&amp;nbsp;&lt;/STRONG&gt;for the link URL and the link's text.&lt;/P&gt;&lt;P&gt;That attribute is coming from the var&amp;nbsp;&lt;STRONG&gt;link&lt;/STRONG&gt;. And that variable is defined as:&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;var link = Iif(IsEmpty($datapoint["Project_Folder_URL"]), '', 'View Project Files');&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In other words,&amp;nbsp;&lt;STRONG&gt;link&lt;/STRONG&gt; will only ever hold two values:&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;'' (an empty string)&lt;/LI&gt;&lt;LI&gt;"View Project Files"&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;When you attempt to build a URL, and the URL is invalid, AGOL apps will often just convert the URL to a link to the current page.&lt;/P&gt;&lt;P&gt;I would suggest, as an alternative approach, using an attribute to change the&amp;nbsp;&lt;STRONG&gt;display&lt;/STRONG&gt; tag in your inline CSS. Set your &amp;lt;a&amp;gt; object to link directly to the&amp;nbsp;&lt;STRONG&gt;Project_Folder_URL&amp;nbsp;&lt;/STRONG&gt;attribute, have the text set to a static&amp;nbsp;&lt;STRONG&gt;View Project Files&lt;/STRONG&gt;, and re-write the&amp;nbsp;&lt;STRONG&gt;link&lt;/STRONG&gt; variable to the following:&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;var link = Iif(IsEmpty($datapoint["Project_Folder_URL"]), 'none', '-webkit-box')&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Then adjust the HTML like so:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;&amp;lt;div style="-webkit-box-orient:vertical; -webkit-line-clamp:{expression/maxDescriptionLines1}; display:{expression/project_url}; font-size:12px; font-weight:200; margin-bottom:0.3rem; opacity:0.6; overflow:hidden; padding:0.3rem 0; text-overflow:ellipsis"&amp;gt;&amp;lt;a href="{Project_Folder_URL}"&amp;gt;View Project Files&amp;lt;/a&amp;gt;&amp;lt;/div&amp;gt;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;That way you can effectively hide the entire element when no URL is present in the data, while also unambiguously providing the link information when there is any.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 20 May 2022 15:06:23 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-dashboards-questions/urls-in-list-data-expression/m-p/1175943#M6329</guid>
      <dc:creator>jcarlson</dc:creator>
      <dc:date>2022-05-20T15:06:23Z</dc:date>
    </item>
    <item>
      <title>Re: URLs in List Data Expression</title>
      <link>https://community.esri.com/t5/arcgis-dashboards-questions/urls-in-list-data-expression/m-p/1175948#M6330</link>
      <description>&lt;P&gt;Hi Josh,&lt;/P&gt;&lt;P&gt;Thank you! I guess that I thought the way I'd linked in the HTML would overcome the logic in my Iif &amp;amp; IsEmpty statements.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Your solution works perfectly and is much appreciated (as always!).&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 20 May 2022 15:35:30 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-dashboards-questions/urls-in-list-data-expression/m-p/1175948#M6330</guid>
      <dc:creator>erica_poisson</dc:creator>
      <dc:date>2022-05-20T15:35:30Z</dc:date>
    </item>
    <item>
      <title>Re: URLs in List Data Expression</title>
      <link>https://community.esri.com/t5/arcgis-dashboards-questions/urls-in-list-data-expression/m-p/1399768#M9302</link>
      <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/363906"&gt;@jcarlson&lt;/a&gt;&amp;nbsp;- hoping you can help with this.&lt;/P&gt;&lt;P&gt;I have a piece of text - for simplicity, we will just say Click Here.&lt;/P&gt;&lt;P&gt;If I enter the &amp;lt;Source&amp;gt; within my List in the Dashboard and write the HTML (including an {expression/attributename}) as part of the URL string, when I click off of &amp;lt;Source&amp;gt; and back again, the expression is removed from the &amp;lt;Source&amp;gt;.&lt;/P&gt;&lt;P&gt;However, if I select the text and then click the Link button and choose {expression/attributename} as the URL, then it is retained.&lt;/P&gt;&lt;P&gt;That's great....except, I would like to force the link to open in a new tab (target="_blank"), but if I switch over to the &amp;lt;Source&amp;gt; tab and input that, then my link is removed. When I put the link back via the Link button, then my target parameter is removed....&lt;/P&gt;&lt;P&gt;Appreciate any ideas.&amp;nbsp; Thanks!&lt;/P&gt;</description>
      <pubDate>Fri, 22 Mar 2024 18:31:27 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-dashboards-questions/urls-in-list-data-expression/m-p/1399768#M9302</guid>
      <dc:creator>KatClifton</dc:creator>
      <dc:date>2024-03-22T18:31:27Z</dc:date>
    </item>
  </channel>
</rss>

