<?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: ArcGIS Pro popup element not sticking in ArcGIS Pro Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-questions/arcgis-pro-popup-element-not-sticking/m-p/1501465#M85245</link>
    <description>&lt;P&gt;Do this and force I think the cache running to stop. You can usually salvage it this route. Project recovery is also mostly good if it crashes. I tend to pause the map OP if I know I’m gonna add a lot of data.&lt;/P&gt;</description>
    <pubDate>Thu, 04 Jul 2024 08:10:45 GMT</pubDate>
    <dc:creator>palatisa1</dc:creator>
    <dc:date>2024-07-04T08:10:45Z</dc:date>
    <item>
      <title>ArcGIS Pro popup element not sticking</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/arcgis-pro-popup-element-not-sticking/m-p/1501449#M85242</link>
      <description>&lt;P&gt;I have configured popups in ArcGIS Pro but they sometimes don't stick.&lt;BR /&gt;There are multiple layers where this is a problem and for the most part the majority of the fields are the same with some additions depending on the asset type.&amp;nbsp;&lt;BR /&gt;The gist of my popup element is&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;var popupContent = "&amp;lt;table style='border-collapse: collapse;'&amp;gt;"; // Initialize popup content as an HTML table
var fields = []; // Array to hold the fields and their values
var cellPadding = "8px"; // Adjust padding as needed
// Access feature attributes and push them into the fields array
Push(fields, { name: "Facility ID", value: $feature.facility_ID });
Push(fields, { name: "Name", value: $feature.name });
Push(fields, { name: "Description", value: $feature.description });
Push(fields, { name: "Asset Status", value: DomainName($feature,"asset_status") });
Push(fields, { name: "Beam Type", value: DomainName($feature,"type") });
Push(fields, { name: "Beam Position", value: DomainName($feature,"position") });
Push(fields, { name: "Material", value: DomainName($feature,"material") });
Push(fields, { name: "Install Date", value: Text($feature.install_date,"dddd DD MMMM Y") });
Push(fields, { name: "Length", value: Round($feature.length,2) + " "+ DomainName($feature,"distance_UOM")});
Push(fields, { name: "Width", value: Round($feature.width,2) + " "+ DomainName($feature,"distance_UOM")});
Push(fields, { name: "Maintained By", value: DomainName($feature,"maintained_by") });
Push(fields, { name: "Owner", value: DomainName($feature,"ownership") });
Push(fields, { name: "Condition Assessment Rating", value: DomainName($feature,"ca_rating") });
Push(fields, { name: "Condition Assessment Date", value: Text($feature.ca_date,"dddd DD MMMM Y") }); // Include formatted CA date directly
Push(fields, { name: "Condition Assessment Comments", value: $feature.ca_comments });
Push(fields, { name: "Collection Method", value: $feature.collection_method });
Push(fields, { name: "Source", value: $feature.source });
Push(fields, { name: "Source Date", value: Text($feature.source_date,"dddd DD MMMM Y") });
Push(fields, { name: "Berth", value: $feature.berth});
Push(fields, { name: "Precinct", value: $feature.wharf});
Push(fields, { name: "Port", value: DomainName($feature,"terminal")});
Push(fields, { name: "Comments", value: $feature.comments});

// Count the number of non-empty fields
var validFieldCount = 0;
for (var i = 0; i &amp;lt; Count(fields); i++) {
    var field = fields[i];
    if (field.value != null &amp;amp;&amp;amp; field.value != "" &amp;amp;&amp;amp; field.value != 0 &amp;amp;&amp;amp; field.value != 0 + " ") {
        validFieldCount++;
    }
}
// Add fields to popup content
for (var i = 0; i &amp;lt; Count(fields); i++) {
    var field = fields[i];
    if (field.value != null &amp;amp;&amp;amp; field.value != "" &amp;amp;&amp;amp; field.value != 0 &amp;amp;&amp;amp; field.value != 0 + " ") {
        popupContent += "&amp;lt;tr style='background-color:" +  "'&amp;gt;&amp;lt;td style='padding:" + cellPadding + "'&amp;gt;&amp;lt;b&amp;gt;" + field.name + ":&amp;lt;/b&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;td style='padding:" + cellPadding + "; '&amp;gt;" + field.value + "&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;";
    }
}
popupContent += "&amp;lt;/table&amp;gt;"; // Close the HTML table tag
// Return statement adjusted for popupElement
return {
    type: "text",
    text: popupContent
};&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;SPAN&gt;Sometimes it reverts to&amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;var popupContent = " " + field.name + ": " + field.value + " "; // Close the HTML table tag // Return statement adjusted for popupElement return { type: "text", text: popupContent };&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Other times it can revert to&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;return {
type: "text",
text: popupContent
};&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;which is the default arcade element text option when clicking on the 'Arcade' button in the configure popups dialog box in ArcGIS Pro.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;I cannot for the life of me figure out what is going on. i have checked the field types and names and it will preview OK, but it just doesn't stick. Can anyone help or should i escalate to tech support?&lt;/P&gt;&lt;P&gt;The reason i'm specific with my listing of fields is because i have another question pending about the fields being returned in alphabetical order when i use the following as my popup:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;var popupContent = "&amp;lt;table style='border-collapse: collapse;'&amp;gt;";
var cellPadding = "8px"; // Adjust padding as needed

// Field map to hold the field names and their corresponding values
var fieldMap = {
    "Facility ID": $feature.facility_ID,
    "Name": $feature.name,
    "Description": $feature.description,
    "Wharf": $feature.wharf,
    "Berth": $feature.berth,
    "Condition Assessment Rating": $feature.ca_rating,
    "Condition Assessment Date": Text($feature.ca_date, "dddd DD MMMM Y"),
    "Condition Assessment Comments": $feature.ca_comments,
    "Collection Method": $feature.collection_method,
    "Source": $feature.source,
    "Source Date": Text($feature.source_date, "dddd DD MMMM Y")
};

// Add fields to popup content
var i = 0;
for (var fieldName in fieldMap) {
    var fieldValue = fieldMap[fieldName];
    if (fieldValue != null &amp;amp;&amp;amp; fieldValue != "") {
        var rowColor;
        if (i % 2 == 0) {
            rowColor = "#FBFBFB";
        } else {
            rowColor = "#EDEDED";
        }
        popupContent += "&amp;lt;tr style='background-color:" + rowColor + "'&amp;gt;&amp;lt;td style='padding:" + cellPadding + "'&amp;gt;&amp;lt;b&amp;gt;" + fieldName + ":&amp;lt;/b&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;td style='padding:" + cellPadding + "'&amp;gt;" + fieldValue + "&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;";
        i++;
    }
}

popupContent += "&amp;lt;/table&amp;gt;";

// Return statement adjusted for popupElement
return { 
type: "text", 
text: popupContent 
};&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Warm regards,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Sian Doherty&lt;/P&gt;&lt;P&gt;Spatial Analyst (GHD Digital)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 04 Jul 2024 05:42:07 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/arcgis-pro-popup-element-not-sticking/m-p/1501449#M85242</guid>
      <dc:creator>Sian_Doherty_GHD</dc:creator>
      <dc:date>2024-07-04T05:42:07Z</dc:date>
    </item>
    <item>
      <title>Re: ArcGIS Pro popup element not sticking</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/arcgis-pro-popup-element-not-sticking/m-p/1501465#M85245</link>
      <description>&lt;P&gt;Do this and force I think the cache running to stop. You can usually salvage it this route. Project recovery is also mostly good if it crashes. I tend to pause the map OP if I know I’m gonna add a lot of data.&lt;/P&gt;</description>
      <pubDate>Thu, 04 Jul 2024 08:10:45 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/arcgis-pro-popup-element-not-sticking/m-p/1501465#M85245</guid>
      <dc:creator>palatisa1</dc:creator>
      <dc:date>2024-07-04T08:10:45Z</dc:date>
    </item>
    <item>
      <title>Re: ArcGIS Pro popup element not sticking</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/arcgis-pro-popup-element-not-sticking/m-p/1501733#M85271</link>
      <description>&lt;P&gt;Thanks &lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/811936"&gt;@palatisa1&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Unfortunately project recovery will do nothing as even if I save the project after previewing the successful pop-up, it just doesn't stick. Cache is set to clear upon exit. I've just got snippets saved as .js files and I usually just copy and paste it back prior to publishing. However, sometimes that works and sometimes it doesn't, so i'm looking for a permanent solution.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 05 Jul 2024 04:35:37 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/arcgis-pro-popup-element-not-sticking/m-p/1501733#M85271</guid>
      <dc:creator>Sian_Doherty_GHD</dc:creator>
      <dc:date>2024-07-05T04:35:37Z</dc:date>
    </item>
    <item>
      <title>Re: ArcGIS Pro popup element not sticking</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/arcgis-pro-popup-element-not-sticking/m-p/1502695#M85337</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/811936"&gt;@palatisa1&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;&lt;P&gt;Do this and force I think the cache running to stop. You can usually salvage it this route. Project recovery is also mostly good if it crashes. I tend to pause the map OP if I know I’m gonna add a lot of data&amp;nbsp;&lt;SPAN&gt;&lt;A href="https://9apps.ooo/" target="_blank" rel="noopener"&gt;https://9apps.ooo/&lt;/A&gt;&lt;/SPAN&gt; .&lt;/P&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;I got this,..&lt;/P&gt;</description>
      <pubDate>Mon, 08 Jul 2024 19:11:54 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/arcgis-pro-popup-element-not-sticking/m-p/1502695#M85337</guid>
      <dc:creator>palatisa1</dc:creator>
      <dc:date>2024-07-08T19:11:54Z</dc:date>
    </item>
  </channel>
</rss>

