<?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: Omit Fields without data from the Pop up Window on Online MapViewer in ArcGIS Online Questions</title>
    <link>https://community.esri.com/t5/arcgis-online-questions/omit-fields-without-data-from-the-pop-up-window-on/m-p/1588833#M63785</link>
    <description>&lt;P&gt;Yes!!!!!!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you so much! It works!! &lt;span class="lia-unicode-emoji" title=":folded_hands:"&gt;🙏&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 25 Feb 2025 03:41:57 GMT</pubDate>
    <dc:creator>WFCAdmin</dc:creator>
    <dc:date>2025-02-25T03:41:57Z</dc:date>
    <item>
      <title>Omit Fields without data from the Pop up Window on Online MapViewer</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/omit-fields-without-data-from-the-pop-up-window-on/m-p/1588297#M63757</link>
      <description>&lt;P&gt;I recently reached out for help on this topic and &lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/15530"&gt;@RhettZufelt&lt;/a&gt; and&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/595273"&gt;@gis_KIWI4&lt;/a&gt; we very helpful in getting me going.&lt;/P&gt;&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/595273"&gt;@gis_KIWI4&lt;/a&gt;provided me with the following arcade expression.&lt;/P&gt;&lt;PRE&gt;var attributes = Dictionary($feature)["attributes"];
var fieldInfos = [];
var attributeValues = {};


var excludeFields = ["OBJECTID", "EditDate"]; //Use this to exclude any fields, null or not null


var layer_schema = Schema($feature);
var fieldAliases = {};


for (var i = 0; i &amp;lt; Count(layer_schema.fields); i++) {
    var field = layer_schema.fields[i];
    fieldAliases[field.name] = field.alias;
}


for (var key in attributes) {
    var value = attributes[key];


    if (!IsEmpty(value) &amp;amp;&amp;amp; value != "" &amp;amp;&amp;amp; IndexOf(excludeFields, key) == -1) {
        var displayName = key; // Default to field name
        
        // Use alias if available
        if (HasKey(fieldAliases, key)) {
            displayName = fieldAliases[key];
        }
        
        Push(fieldInfos, { fieldName: key, label: displayName });
        attributeValues[key] = value;
    }
}



return {
    type: 'fields',
    fieldInfos: fieldInfos,
    attributes: attributeValues
};&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This returns the pop-ups perfectly, with display names rather than field names.&lt;/P&gt;&lt;P&gt;My issue is, it only works on the first point I select. If I click on a second point, it won't pull up any pop-ups.&lt;/P&gt;&lt;P&gt;If I then click on another layer with a pop-up and then back on the filtered pop-up layer it works again. It's like it only works once and then needs something to reset it.&lt;/P&gt;&lt;P&gt;Any help troubleshooting this would be much appreciated!&lt;/P&gt;</description>
      <pubDate>Sat, 22 Feb 2025 18:41:02 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/omit-fields-without-data-from-the-pop-up-window-on/m-p/1588297#M63757</guid>
      <dc:creator>WFCAdmin</dc:creator>
      <dc:date>2025-02-22T18:41:02Z</dc:date>
    </item>
    <item>
      <title>Re: Omit Fields without data from the Pop up Window on Online MapViewer</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/omit-fields-without-data-from-the-pop-up-window-on/m-p/1588620#M63767</link>
      <description>&lt;P&gt;Looking into this some more, I am seeing the same thing, but not sure why.&lt;/P&gt;&lt;P&gt;However, after the first one, it is returning data, but ONLY the system managed fields (Creator, GlobalID, OBJECTID, etc.) that I don't have in the&amp;nbsp;excludeFields list.&lt;/P&gt;&lt;P&gt;So, for whatever reason, it only system-maintained fields after the initial popup until I select another layer then switch back.&lt;/P&gt;&lt;P&gt;I have also noticed that it only behaves this way when I have editing capabilities.&amp;nbsp; If I open share this and open it with just read, then I never get the full popup, just the non-excluded system fields...&lt;/P&gt;&lt;P&gt;Maybe this will help someone figure out why?&lt;/P&gt;&lt;P&gt;R_&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 24 Feb 2025 17:23:26 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/omit-fields-without-data-from-the-pop-up-window-on/m-p/1588620#M63767</guid>
      <dc:creator>RhettZufelt</dc:creator>
      <dc:date>2025-02-24T17:23:26Z</dc:date>
    </item>
    <item>
      <title>Re: Omit Fields without data from the Pop up Window on Online MapViewer</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/omit-fields-without-data-from-the-pop-up-window-on/m-p/1588657#M63769</link>
      <description>&lt;P&gt;I've found that for whatever reason, the pop-up arcade profile seems to want to quit working when there are multiple assignments on a variable and nested if statements. Not sure if this is performance related or what.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I modified the second for loop in the following ways. First - I added a "!IsNan()" condition to the primary if statement, in the event there is a "NaN" value for extra coverage (you can omit this change if you want). Additionally, I have eliminated the nested if statement, as this is redundant and possibly impacting the functionality in my experience. All fields will return with a field alias, even if the field alias is just the field name. It is simpler to just set the display name to the value from the field alias dictionary.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In testing around in my own layer, I have not been able to replicate the issue since making this modification.&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;for (var key in attributes) {
    var value = attributes[key];

    // Added !IsNan(value) condition
    if (!IsNan(vale) &amp;amp;&amp;amp; !IsEmpty(value) &amp;amp;&amp;amp; value != "" &amp;amp;&amp;amp; IndexOf(excludeFields, key) == -1) {
        var displayName = fieldAliases[key]; // Default to field name
        
        // Removing this for simplicity - All keys will have "aliases." 
				//Even fields without a formally defined alias will present with the fieldname as their alias.
				
				// Use alias if available
        //if (HasKey(fieldAliases, key)) {
        //    displayName = fieldAliases[key];
        //}
        
        Push(fieldInfos, { fieldName: key, label: displayName });
        attributeValues[key] = value;
    }&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 24 Feb 2025 18:18:27 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/omit-fields-without-data-from-the-pop-up-window-on/m-p/1588657#M63769</guid>
      <dc:creator>AustinAverill</dc:creator>
      <dc:date>2025-02-24T18:18:27Z</dc:date>
    </item>
    <item>
      <title>Re: Omit Fields without data from the Pop up Window on Online MapViewer</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/omit-fields-without-data-from-the-pop-up-window-on/m-p/1588780#M63779</link>
      <description>&lt;P&gt;I tried this modification, but made no difference.&amp;nbsp; Would still work as expected, once, then would only show system managed fields.&amp;nbsp;&lt;/P&gt;&lt;P&gt;However, playing around with it, I noticed that it will display the system managed fields &lt;STRONG&gt;AND&lt;/STRONG&gt; any fields that are loaded elsewhere like the title or field list.&lt;/P&gt;&lt;P&gt;So, figured I'm make sure and 'load' all fields into the script and I tested both the original and modified script by adding:&lt;/P&gt;&lt;LI-CODE lang="c"&gt;Expects($feature, '*')    &lt;/LI-CODE&gt;&lt;P&gt;as the first line.&lt;/P&gt;&lt;P&gt;Now it seems to be working as expected, and populates all non-empty fields (that aren't in the exclude list) each time I click on a feature.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;It still re-orders them alphabetically though, have not figured that one out yet.......&lt;/P&gt;&lt;P&gt;R_&lt;/P&gt;</description>
      <pubDate>Mon, 24 Feb 2025 23:16:43 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/omit-fields-without-data-from-the-pop-up-window-on/m-p/1588780#M63779</guid>
      <dc:creator>RhettZufelt</dc:creator>
      <dc:date>2025-02-24T23:16:43Z</dc:date>
    </item>
    <item>
      <title>Re: Omit Fields without data from the Pop up Window on Online MapViewer</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/omit-fields-without-data-from-the-pop-up-window-on/m-p/1588832#M63784</link>
      <description>&lt;P&gt;Thank you so much! Your script along with&lt;/P&gt;&lt;PRE&gt;Expects($feature, '*')    &lt;/PRE&gt;&lt;P&gt;At the beginning works!!&lt;/P&gt;</description>
      <pubDate>Tue, 25 Feb 2025 03:41:33 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/omit-fields-without-data-from-the-pop-up-window-on/m-p/1588832#M63784</guid>
      <dc:creator>WFCAdmin</dc:creator>
      <dc:date>2025-02-25T03:41:33Z</dc:date>
    </item>
    <item>
      <title>Re: Omit Fields without data from the Pop up Window on Online MapViewer</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/omit-fields-without-data-from-the-pop-up-window-on/m-p/1588833#M63785</link>
      <description>&lt;P&gt;Yes!!!!!!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you so much! It works!! &lt;span class="lia-unicode-emoji" title=":folded_hands:"&gt;🙏&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 25 Feb 2025 03:41:57 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/omit-fields-without-data-from-the-pop-up-window-on/m-p/1588833#M63785</guid>
      <dc:creator>WFCAdmin</dc:creator>
      <dc:date>2025-02-25T03:41:57Z</dc:date>
    </item>
  </channel>
</rss>

