<?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: Arcade Popup Expression Not working in Field Maps in ArcGIS Field Maps Questions</title>
    <link>https://community.esri.com/t5/arcgis-field-maps-questions/arcade-popup-expression-not-working-in-field-maps/m-p/1571513#M10180</link>
    <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/347312"&gt;@JCGuarneri&lt;/a&gt;&amp;nbsp;I am having this same exact issue and I cannot figure out what is going on. However, there is one main difference...and it is weird. If a record has a null date value in the date field, Field Maps will show any records with a null date field in the HTML table. The other strange thing, though, is that when I remove the date field values from the HTML table, it still doesn't work, but still shows the null date records. It is almost like there is an issue with the Feature Set and date fields in Field Maps. Maybe something is getting encoded incorrectly and not rendering properly?&lt;/P&gt;&lt;P&gt;I am on ArcGIS Enterprise 11.3 and Field Maps 24.3.0&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 27 Dec 2024 18:18:37 GMT</pubDate>
    <dc:creator>James_Whitacre_PGC</dc:creator>
    <dc:date>2024-12-27T18:18:37Z</dc:date>
    <item>
      <title>Arcade Popup Expression Not working in Field Maps</title>
      <link>https://community.esri.com/t5/arcgis-field-maps-questions/arcade-popup-expression-not-working-in-field-maps/m-p/1549667#M9764</link>
      <description>&lt;P&gt;I'm working on an Arcade content block expression for a popup that will be viewed in Field Maps. The goals are to show a link to a CW inspection or work order that needs to be completed (if applicable), and to display a table summarizing previous work on that asset. It works great in the map viewer, but does not work in Field Maps. Interestingly, the link fails completely, but the table will draw only the header row. I've split those two functions into different content blocks so I'm only dealing with one issue at&amp;nbsp; a time. I've included screenshots and code snippets below. Anyone have an idea how to get that to work? I know I can get the hyperlink to work if I just pass it as a hyperlink in a text block, but that removes the "only show it if applicable" logic. The table is what really mystifies me, as the header displays just fine.&lt;/P&gt;&lt;P&gt;For reference, I'm on&amp;nbsp; Enterprise 11.1 and Field Maps 24.2.1&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="JCGuarneri_2-1729193367619.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/117492i90F2BF6CC8C5BA5A/image-size/medium?v=v2&amp;amp;px=400" role="button" title="JCGuarneri_2-1729193367619.png" alt="JCGuarneri_2-1729193367619.png" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;JCGuarneri_2-1729193367619.png&lt;/span&gt;&lt;/span&gt;&lt;/P&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="JCGuarneri_1-1729192941980.jpeg" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/117489i8D69F8F614F25A11/image-size/medium?v=v2&amp;amp;px=400" role="button" title="JCGuarneri_1-1729192941980.jpeg" alt="JCGuarneri_1-1729192941980.jpeg" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;JCGuarneri_1-1729192941980.jpeg&lt;/span&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is my code for the link:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;//get open hydrant inspections
var currentInspections = FeatureSetByName($map, "Open Hydrant Dry Checks",['InspectionId']);
//find the inspection that matches this hydratn
var cwID = $feature.CW_ID;
var query = `FeatureUid = '${cwID}'`;
var inspNow = Filter(currentInspections,query);
//base url
var baseURL = "cityworks11://openWorkActivity?workActivityType=2&amp;amp;workActivityId=";
//if there is an inspection, create link
If(Count(inspNow)&amp;gt;0){
var inspectionID = First(inspNow)["InspectionId"];
var inspURL = baseURL + inspectionID;
var linkText = `&amp;lt;a href="${inspURL}" &amp;gt;Complete Dry Check Inspection In Cityworks Mobile&amp;lt;/a&amp;gt;`;
}
//if not, return a blank line
else{
  var linkText = ``;
}
return { 
	type : 'text', 
	text : linkText //this property supports html tags 
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And here is the code for the table:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;//get previous inspections and find those that are for this hydrant
var prevInspections = FeatureSetByName($map, "Previous Hydrant Inspections",['InspectionId','InspTemplateName','InspDate','ObservationSum','FeatureUid']);
var cwID = $feature.CW_ID;
var query = `FeatureUid = '${cwID}'`;
var relInspections = OrderBy(Filter(prevInspections,query), 'InspDate DESC');

//start HTML text with table header
var baseText = `&amp;lt;table&amp;gt;
&amp;lt;tr&amp;gt;
&amp;lt;th align = "left" width = "100"&amp;gt;Date&amp;lt;/th&amp;gt;
&amp;lt;th align = "left" width = "120"&amp;gt;Inspection Type&amp;lt;/th&amp;gt;
&amp;lt;th&amp;gt;Summary&amp;lt;/th&amp;gt;
&amp;lt;/tr&amp;gt;
`

//build table with alternating color rows
count = 1;
for(var i in relInspections){
  var inspDate = `${Month(i.InspDate)}/${Day(i.InspDate)}/${Year(i.InspDate)}`;
  var inspType = Decode(i.InspTemplateName,"Hydrant Dry Check Inspection",'Dry Check',"Hydrant Wet Check Inspection","Wet Check","Other");
  var color = IIf(count%2==0 , '#ffffff', '#e6e6e6');
  count += 1;

  var newRow = `&amp;lt;tr style = "background-color:${color}"&amp;gt;
&amp;lt;td&amp;gt;${inspDate}&amp;lt;/td&amp;gt;
&amp;lt;td&amp;gt;${inspType}&amp;lt;/td&amp;gt;
&amp;lt;td&amp;gt;${i.ObservationSum}&amp;lt;/td&amp;gt;
&amp;lt;/tr&amp;gt;`;
baseText += newRow;
}
//finish HTML text
baseText += `&amp;lt;/table&amp;gt;`;
return { 
	type : 'text', 
	text : baseText
}&lt;/LI-CODE&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;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 18 Oct 2024 11:19:16 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-field-maps-questions/arcade-popup-expression-not-working-in-field-maps/m-p/1549667#M9764</guid>
      <dc:creator>JCGuarneri</dc:creator>
      <dc:date>2024-10-18T11:19:16Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade Popup Expression Not working in Field Maps</title>
      <link>https://community.esri.com/t5/arcgis-field-maps-questions/arcade-popup-expression-not-working-in-field-maps/m-p/1549698#M9765</link>
      <description>&lt;P&gt;Some additional testing reveals that I can add a single dummy row in by using hard coded values, but&amp;nbsp;&lt;STRONG&gt;only outside of the for loop&lt;/STRONG&gt;. Inside the for loop, the rows are not getting added, but it works fine outside of the loop. So the following code results in this in map viewer:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="JCGuarneri_0-1729194395796.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/117495i1C38BF90C292F838/image-size/medium?v=v2&amp;amp;px=400" role="button" title="JCGuarneri_0-1729194395796.png" alt="JCGuarneri_0-1729194395796.png" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;JCGuarneri_0-1729194395796.png&lt;/span&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;and this in Field Maps:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="JCGuarneri_1-1729195221638.jpeg" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/117498iD5F408F49C0EE656/image-size/medium?v=v2&amp;amp;px=400" role="button" title="JCGuarneri_1-1729195221638.jpeg" alt="JCGuarneri_1-1729195221638.jpeg" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;JCGuarneri_1-1729195221638.jpeg&lt;/span&gt;&lt;/span&gt;&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;LI-CODE lang="javascript"&gt;//start HTML text with table header
var baseText = `&amp;lt;table&amp;gt;
&amp;lt;tr&amp;gt;
&amp;lt;th align = "left" width = "100"&amp;gt;Date&amp;lt;/th&amp;gt;
&amp;lt;th align = "left" width = "120"&amp;gt;Inspection Type&amp;lt;/th&amp;gt;
&amp;lt;th&amp;gt;Summary&amp;lt;/th&amp;gt;
&amp;lt;/tr&amp;gt;
`

baseText += `&amp;lt;tr style = "background-color:#e6ff03"&amp;gt;
&amp;lt;td&amp;gt;1/1/2024&amp;lt;/td&amp;gt;
&amp;lt;td&amp;gt;Wet Check&amp;lt;/td&amp;gt;
&amp;lt;td&amp;gt;This inspection never happened&amp;lt;/td&amp;gt;
&amp;lt;/tr&amp;gt;`;
//build table with alternating color rows
count = 1;
for(var i in relInspections){
  var inspDate = `${Month(i.InspDate)}/${Day(i.InspDate)}/${Year(i.InspDate)}`;
  var inspType = Decode(i.InspTemplateName,"Hydrant Dry Check Inspection",'Dry Check',"Hydrant Wet Check Inspection","Wet Check","Other");
  var color = IIf(count%2==0 , '#ffffff', '#e6e6e6');
  count += 1;

  var newRow = `&amp;lt;tr style = "background-color:${color}"&amp;gt;
&amp;lt;td&amp;gt;${inspDate}&amp;lt;/td&amp;gt;
&amp;lt;td&amp;gt;${inspType}&amp;lt;/td&amp;gt;
&amp;lt;td&amp;gt;${i.ObservationSum}&amp;lt;/td&amp;gt;
&amp;lt;/tr&amp;gt;`;
baseText += newRow;
baseText += `&amp;lt;tr style = "background-color:#e6ff03"&amp;gt;
&amp;lt;td&amp;gt;1/1/2024&amp;lt;/td&amp;gt;
&amp;lt;td&amp;gt;Wet Check&amp;lt;/td&amp;gt;
&amp;lt;td&amp;gt;This inspection never happened&amp;lt;/td&amp;gt;
&amp;lt;/tr&amp;gt;`;
}
//finish HTML text
baseText += `&amp;lt;/table&amp;gt;`;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 17 Oct 2024 20:00:43 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-field-maps-questions/arcade-popup-expression-not-working-in-field-maps/m-p/1549698#M9765</guid>
      <dc:creator>JCGuarneri</dc:creator>
      <dc:date>2024-10-17T20:00:43Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade Popup Expression Not working in Field Maps</title>
      <link>https://community.esri.com/t5/arcgis-field-maps-questions/arcade-popup-expression-not-working-in-field-maps/m-p/1549808#M9768</link>
      <description>&lt;LI-CODE lang="c"&gt;var currentInspections = FeatureSetByName($map, "Open Hydrant Dry Checks",['InspectionId']);
//find the inspection that matches this hydratn
var cwID = $feature.CW_ID;
var query = `FeatureUid = '${cwID}'`;
var inspNow = Filter(currentInspections,query);&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It looks like you are making a featureset and getting one field - InspectionID - but then filtering the featureset by another field, FeatureUid? I'm imagining this will cause issues unless it's always included in the feature set results.&lt;/P&gt;&lt;P&gt;Do you get any issues if you return the results within a text block as an expression, instead of an arcade block?&lt;/P&gt;&lt;P&gt;Can you go to the Field Maps logs or interact with the error? It could give more insight, e.g. I've seen this before when the expression hasn't returned a result for the feature. Because a correct return wasn't provided it throws an error. The logs identified this.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 18 Oct 2024 05:32:51 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-field-maps-questions/arcade-popup-expression-not-working-in-field-maps/m-p/1549808#M9768</guid>
      <dc:creator>ChristopherCounsell</dc:creator>
      <dc:date>2024-10-18T05:32:51Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade Popup Expression Not working in Field Maps</title>
      <link>https://community.esri.com/t5/arcgis-field-maps-questions/arcade-popup-expression-not-working-in-field-maps/m-p/1549865#M9769</link>
      <description>&lt;P&gt;That's a good catch, and a symptom of copy/pasting code from another layer. Interestingly, it still seems to return the correct result whether or not I explicitly include the FeatureUid field:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="JCGuarneri_0-1729249952120.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/117525i36493DCE522B8AB2/image-size/medium?v=v2&amp;amp;px=400" role="button" title="JCGuarneri_0-1729249952120.png" alt="JCGuarneri_0-1729249952120.png" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;JCGuarneri_0-1729249952120.png&lt;/span&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;I did try explicitly including it and it still errors out on the Field Maps side. I also tried hardcoding a URL to our company web site, and Field maps still doesn't like it. It looks like field maps has trouble with the &amp;lt;a&amp;gt; HTML tag, even though that's listed as supported HTML.&lt;/P&gt;&lt;P&gt;I also realized I pasted the wrong code in for the table portion. I've corrected that now if you are interested in that as well.&lt;/P&gt;</description>
      <pubDate>Fri, 18 Oct 2024 11:27:56 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-field-maps-questions/arcade-popup-expression-not-working-in-field-maps/m-p/1549865#M9769</guid>
      <dc:creator>JCGuarneri</dc:creator>
      <dc:date>2024-10-18T11:27:56Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade Popup Expression Not working in Field Maps</title>
      <link>https://community.esri.com/t5/arcgis-field-maps-questions/arcade-popup-expression-not-working-in-field-maps/m-p/1550219#M9780</link>
      <description>&lt;P&gt;We use the &amp;lt;a&amp;gt; tag without issues.&lt;/P&gt;&lt;P&gt;Is it because you're trying to open an app that may not be approved on iOS and Android stores?&lt;/P&gt;&lt;P&gt;&lt;A href="https://doc.arcgis.com/en/survey123/get-started/integrate-launchanotherapp.htm" target="_blank"&gt;https://doc.arcgis.com/en/survey123/get-started/integrate-launchanotherapp.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;I'm not sure that short URLs to open another app would work for Citi works.&lt;/P&gt;</description>
      <pubDate>Fri, 18 Oct 2024 22:28:15 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-field-maps-questions/arcade-popup-expression-not-working-in-field-maps/m-p/1550219#M9780</guid>
      <dc:creator>ChristopherCounsell</dc:creator>
      <dc:date>2024-10-18T22:28:15Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade Popup Expression Not working in Field Maps</title>
      <link>https://community.esri.com/t5/arcgis-field-maps-questions/arcade-popup-expression-not-working-in-field-maps/m-p/1550821#M9796</link>
      <description>&lt;P&gt;I don't think that's it. The Cityworks URL works fine for me in a slightly different context. Our current way to handle this is to have a popup on the inspection feature layer. The popup has an expression that builds the URL string, which is returned as text and fed to a hyperlink in a text popup element. I built this back in the old map builder and it works just fine. What's funny is that it doesn't work when I bypass that and just go straight for &amp;lt;a&amp;gt;.&lt;/P&gt;&lt;P&gt;Is the &amp;lt;a&amp;gt; tag working for you in Field Maps? And what version of Enterprise are you on?&lt;/P&gt;</description>
      <pubDate>Tue, 22 Oct 2024 12:04:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-field-maps-questions/arcade-popup-expression-not-working-in-field-maps/m-p/1550821#M9796</guid>
      <dc:creator>JCGuarneri</dc:creator>
      <dc:date>2024-10-22T12:04:04Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade Popup Expression Not working in Field Maps</title>
      <link>https://community.esri.com/t5/arcgis-field-maps-questions/arcade-popup-expression-not-working-in-field-maps/m-p/1571513#M10180</link>
      <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/347312"&gt;@JCGuarneri&lt;/a&gt;&amp;nbsp;I am having this same exact issue and I cannot figure out what is going on. However, there is one main difference...and it is weird. If a record has a null date value in the date field, Field Maps will show any records with a null date field in the HTML table. The other strange thing, though, is that when I remove the date field values from the HTML table, it still doesn't work, but still shows the null date records. It is almost like there is an issue with the Feature Set and date fields in Field Maps. Maybe something is getting encoded incorrectly and not rendering properly?&lt;/P&gt;&lt;P&gt;I am on ArcGIS Enterprise 11.3 and Field Maps 24.3.0&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 27 Dec 2024 18:18:37 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-field-maps-questions/arcade-popup-expression-not-working-in-field-maps/m-p/1571513#M10180</guid>
      <dc:creator>James_Whitacre_PGC</dc:creator>
      <dc:date>2024-12-27T18:18:37Z</dc:date>
    </item>
  </channel>
</rss>

