<?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: WebMap Arcade how to hide a field that do not have values in a popup window in ArcGIS Online Questions</title>
    <link>https://community.esri.com/t5/arcgis-online-questions/webmap-arcade-how-to-hide-a-field-that-do-not-have/m-p/1086271#M41594</link>
    <description>&lt;P&gt;Please check the following blog&amp;nbsp;&lt;A href="https://community.esri.com/t5/arcgis-online-documents/hide-field-in-pop-up-using-arcade/ta-p/1029496" target="_self"&gt;Hide Field in Pop-up Using Arcade&lt;/A&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 05 Aug 2021 17:43:13 GMT</pubDate>
    <dc:creator>JayantaPoddar</dc:creator>
    <dc:date>2021-08-05T17:43:13Z</dc:date>
    <item>
      <title>WebMap Arcade how to hide a field that do not have values in a popup window</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/webmap-arcade-how-to-hide-a-field-that-do-not-have/m-p/1086263#M41593</link>
      <description>&lt;P&gt;Hello everyone,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In a WebMap I am looking for a way to&amp;nbsp; hide a field when it does not have values, and show it when it has values in a Popup window, when clicking in&amp;nbsp; feature on the webmap.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 05 Aug 2021 17:25:15 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/webmap-arcade-how-to-hide-a-field-that-do-not-have/m-p/1086263#M41593</guid>
      <dc:creator>JoseSanchez</dc:creator>
      <dc:date>2021-08-05T17:25:15Z</dc:date>
    </item>
    <item>
      <title>Re: WebMap Arcade how to hide a field that do not have values in a popup window</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/webmap-arcade-how-to-hide-a-field-that-do-not-have/m-p/1086271#M41594</link>
      <description>&lt;P&gt;Please check the following blog&amp;nbsp;&lt;A href="https://community.esri.com/t5/arcgis-online-documents/hide-field-in-pop-up-using-arcade/ta-p/1029496" target="_self"&gt;Hide Field in Pop-up Using Arcade&lt;/A&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 05 Aug 2021 17:43:13 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/webmap-arcade-how-to-hide-a-field-that-do-not-have/m-p/1086271#M41594</guid>
      <dc:creator>JayantaPoddar</dc:creator>
      <dc:date>2021-08-05T17:43:13Z</dc:date>
    </item>
    <item>
      <title>Re: WebMap Arcade how to hide a field that do not have values in a popup window</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/webmap-arcade-how-to-hide-a-field-that-do-not-have/m-p/1086286#M41595</link>
      <description>&lt;P&gt;It can be kind of tricky to do this &lt;EM&gt;and &lt;/EM&gt;have it formatted nicely, but here's a way to do it:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="c"&gt;var x = $feature['attribute']

if(!IsEmpty(x)){
    return `\nSome Attribute: ${x}`
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Then in the popup configuration, put all the expressions on the same line. The \n in the returned string will separate multiple values.&lt;/P&gt;&lt;P&gt;To show what this might look like in practice, I'll use a static dict instead of the feature's attributes so that you can see the skipped values. My input:&lt;/P&gt;&lt;PRE&gt;var d = {&lt;BR /&gt;  'first': 'the first value',&lt;BR /&gt;  'second': null,&lt;BR /&gt;  'third': null,&lt;BR /&gt;  'fourth': 'and the fourth'&lt;BR /&gt;}&lt;/PRE&gt;&lt;P&gt;And the popup configuration:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jcarlson_0-1628186774917.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/20285i11DD3715D6FA2433/image-size/medium?v=v2&amp;amp;px=400" role="button" title="jcarlson_0-1628186774917.png" alt="jcarlson_0-1628186774917.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;And the resulting popup:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jcarlson_1-1628186796369.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/20286iCC4C8C4EFBFBD910/image-size/medium?v=v2&amp;amp;px=400" role="button" title="jcarlson_1-1628186796369.png" alt="jcarlson_1-1628186796369.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;You'll have to do extra work if you want the output to look nice or have a tabular alignment, but this can at least give you a list of non-null / non-empty attributes in your feature that won't leave blank spaces.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;EDIT: It occurred to me after posting that that there's no need for multiple expressions. If you build a dict from the attributes you want, you can return a single string with all the attributes in one go:&lt;/P&gt;&lt;LI-CODE lang="c"&gt;var attrs = {
    'First': $feature['attribute1'],
    'Second': $feature['attribute2'],
    'Third': $feature['attribute3']
}

out_str = 'Attributes:'

for(var a in attrs){
    if(!IsEmpty(attrs[a])){
        out_str += `\n${a}: ${attrs[a]}`
    }
}

return out_str&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="jcarlson_0-1628187415289.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/20289i7406F847C67C5EBE/image-size/medium?v=v2&amp;amp;px=400" role="button" title="jcarlson_0-1628187415289.png" alt="jcarlson_0-1628187415289.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 05 Aug 2021 18:16:52 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/webmap-arcade-how-to-hide-a-field-that-do-not-have/m-p/1086286#M41595</guid>
      <dc:creator>jcarlson</dc:creator>
      <dc:date>2021-08-05T18:16:52Z</dc:date>
    </item>
    <item>
      <title>Re: WebMap Arcade how to hide a field that do not have values in a popup window</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/webmap-arcade-how-to-hide-a-field-that-do-not-have/m-p/1086287#M41596</link>
      <description>&lt;P&gt;Here is a simple example that could work:&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;var FIRE = $feature.FIRE
var popuptext = ''

If(FIRE=='Yes'){
    popuptext = 'There is a fire here.';
}

return popuptext&lt;/LI-CODE&gt;</description>
      <pubDate>Thu, 05 Aug 2021 18:08:24 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/webmap-arcade-how-to-hide-a-field-that-do-not-have/m-p/1086287#M41596</guid>
      <dc:creator>BrianBaldwin</dc:creator>
      <dc:date>2021-08-05T18:08:24Z</dc:date>
    </item>
    <item>
      <title>Re: WebMap Arcade how to hide a field that do not have values in a popup window</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/webmap-arcade-how-to-hide-a-field-that-do-not-have/m-p/1086293#M41597</link>
      <description>&lt;P&gt;I can't believe I missed that blog post! That's a &lt;EM&gt;really&lt;/EM&gt; useful example, one that I will be using in a number of maps.&lt;/P&gt;</description>
      <pubDate>Thu, 05 Aug 2021 18:20:18 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/webmap-arcade-how-to-hide-a-field-that-do-not-have/m-p/1086293#M41597</guid>
      <dc:creator>jcarlson</dc:creator>
      <dc:date>2021-08-05T18:20:18Z</dc:date>
    </item>
    <item>
      <title>Re: WebMap Arcade how to hide a field that do not have values in a popup window</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/webmap-arcade-how-to-hide-a-field-that-do-not-have/m-p/1086301#M41598</link>
      <description>&lt;P&gt;Thank you for your samples.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Now how can I make the field clickable, because what I want to show/hide is a ProjectURL&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Fri, 06 Aug 2021 12:03:35 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/webmap-arcade-how-to-hide-a-field-that-do-not-have/m-p/1086301#M41598</guid>
      <dc:creator>JoseSanchez</dc:creator>
      <dc:date>2021-08-06T12:03:35Z</dc:date>
    </item>
    <item>
      <title>Re: WebMap Arcade how to hide a field that do not have values in a popup window</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/webmap-arcade-how-to-hide-a-field-that-do-not-have/m-p/1086308#M41599</link>
      <description>&lt;P&gt;Well, that is a very different thing. If you want &lt;EM&gt;clickable&lt;/EM&gt; links, you have to do it one expression per field, there's just no way to get the "&amp;lt;a href=...&amp;gt;" HTML tags into a dynamic list within a single expression. Configuring a popup to show "&amp;lt;a href={expression/expr0}&amp;gt;{expression/expr0&amp;lt;/a&amp;gt;" works, where the expression returns a valid URL.&lt;/P&gt;&lt;P&gt;However, if the popup was "{expression/expr0}", where the expression returns all the &amp;lt;a href...&amp;gt;&amp;lt;/a&amp;gt; tags &lt;EM&gt;within&lt;/EM&gt; it, that will &lt;EM&gt;not&lt;/EM&gt; work, as the HTML tags will be read and displayed as text characters. With that in mind, you could try:&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;Write an expression for each URL field that only returns something if there's a value.&lt;/LI&gt;&lt;LI&gt;In the popup, define a link to have the text and URL come from that expression.&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jcarlson_0-1628189619074.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/20292iEF5DD9B26D51B3C2/image-size/medium?v=v2&amp;amp;px=400" role="button" title="jcarlson_0-1628189619074.png" alt="jcarlson_0-1628189619074.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;There's no way to get the newline character into the link, however, so you'll be once again stuck with either a really long horizontal string of text, or a tall list with empty rows.&lt;/P&gt;&lt;P&gt;Add to this the fact that your URLs may be long, and you may wish to display some other text. If you wish to do that, you'll need TWO expressions per field, one for the URL, one for the link text.&lt;/P&gt;&lt;P&gt;PS - Sorry for accepting and then unaccepting your post as a solution, I was meaning to click "reply". &lt;span class="lia-unicode-emoji" title=":grimacing_face:"&gt;😬&lt;/span&gt;&lt;/P&gt;&lt;P&gt;EDIT: You could probably get nicer URL labels with one expression per field using the method in the blog post &lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/95280"&gt;@JayantaPoddar&lt;/a&gt; linked to.&lt;/P&gt;</description>
      <pubDate>Thu, 05 Aug 2021 19:01:40 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/webmap-arcade-how-to-hide-a-field-that-do-not-have/m-p/1086308#M41599</guid>
      <dc:creator>jcarlson</dc:creator>
      <dc:date>2021-08-05T19:01:40Z</dc:date>
    </item>
    <item>
      <title>Re: WebMap Arcade how to hide a field that do not have values in a popup window</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/webmap-arcade-how-to-hide-a-field-that-do-not-have/m-p/1086324#M41600</link>
      <description>&lt;P&gt;Thanks Josh,&lt;/P&gt;&lt;P&gt;Your first sample worked for me.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I only have one field that has URL values in my Popup window. And I am not using the table HTML, just the default&amp;nbsp;&amp;nbsp;custom text display.&amp;nbsp; Now it show as a text field, I need to find a way to make if clickable.&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;var relatedrecords = OrderBy(FeatureSetByRelationshipName($feature,"CIPProject"), "ProjectURL")&lt;/P&gt;&lt;P&gt;var cnt = Count(relatedrecords);&lt;BR /&gt;var relatedinfo = "";&lt;BR /&gt;if (cnt &amp;gt; 0) {&lt;BR /&gt;var info = First(relatedrecords);&lt;BR /&gt;relatedinfo = info.ProjectURL ;&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;return relatedinfo;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 06 Aug 2021 12:04:34 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/webmap-arcade-how-to-hide-a-field-that-do-not-have/m-p/1086324#M41600</guid>
      <dc:creator>JoseSanchez</dc:creator>
      <dc:date>2021-08-06T12:04:34Z</dc:date>
    </item>
    <item>
      <title>Re: WebMap Arcade how to hide a field that do not have values in a popup window</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/webmap-arcade-how-to-hide-a-field-that-do-not-have/m-p/1086513#M41611</link>
      <description>&lt;P&gt;Hello again,&lt;/P&gt;&lt;P&gt;I was able to convert the field to a hyperlink field. I just selected the field, added hyperlink and copied&amp;nbsp;{relationships/0/ProjectURL}" inside.&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 06 Aug 2021 12:02:52 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/webmap-arcade-how-to-hide-a-field-that-do-not-have/m-p/1086513#M41611</guid>
      <dc:creator>JoseSanchez</dc:creator>
      <dc:date>2021-08-06T12:02:52Z</dc:date>
    </item>
  </channel>
</rss>

