<?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 pop up with FeatureSetByRelationshipName not working offline in ArcGIS Field Maps Questions</title>
    <link>https://community.esri.com/t5/arcgis-field-maps-questions/arcade-pop-up-with-featuresetbyrelationshipname/m-p/1193384#M4134</link>
    <description>&lt;P&gt;Yes Relationship by name has some bugs in it - one is a . in the name.&amp;nbsp; Using By Name works better.&amp;nbsp; Search the forum this has been posted a number of times.&lt;/P&gt;</description>
    <pubDate>Tue, 19 Jul 2022 13:46:41 GMT</pubDate>
    <dc:creator>DougBrowning</dc:creator>
    <dc:date>2022-07-19T13:46:41Z</dc:date>
    <item>
      <title>Arcade pop up with FeatureSetByRelationshipName not working offline</title>
      <link>https://community.esri.com/t5/arcgis-field-maps-questions/arcade-pop-up-with-featuresetbyrelationshipname/m-p/1191297#M4074</link>
      <description>&lt;P&gt;Hi, I am having an issue with an Arcade expression in a pop while using field maps, specifically in offline mode. I have a feature class (monitoring well) and a linked standalone table (gauging_data). For the popup, I have an arcade expression pulling the most recent data and then I pass that to a survey123 link for further data collection. This all works great online (as shown) but when I pull the map offline I get the following error:&amp;nbsp;&lt;/P&gt;&lt;P&gt;Expression Name: expr1&lt;BR /&gt;Expression Title: Date&lt;BR /&gt;Error Domain: com.esri.arcgis.runtime.error&lt;BR /&gt;Error Code: 15&lt;BR /&gt;Error Description: Invalid call., Unable to evaluate arcade expression. Evaluation_error_code::field_not_found Line :19&lt;/P&gt;&lt;P&gt;My arcade expression is as follows:&lt;/P&gt;&lt;LI-CODE lang="sql"&gt;var relatedrecords = FeatureSetByRelationshipName($feature,"Gauging_Data", ['Well_ID','Depth_to_Water_ft_BTOC', 'Total_Well_Depth_ft_BTOC'], false);

var cnt = Count(relatedrecords);

var relatedinfo = "Date_and_Time";

if (cnt &amp;gt; 0) {
    
    var sortedrecords = OrderBy(relatedrecords, "Date_and_Time DES");

        var latestinfo = First(sortedrecords);
    
    
    relatedinfo = Text(ToLocal(latestinfo["Date_and_Time"]), "M/D/Y");
    
} else {
    
    relatedinfo = "None available";        
}


return relatedinfo&lt;/LI-CODE&gt;&lt;P&gt;I am thinking it might have something to do with GUID/Global ID case sensitivities (&lt;A href="https://community.esri.com/t5/arcgis-field-maps-questions/featureset-not-working-offline-in-field-maps/td-p/1162899" target="_blank"&gt;https://community.esri.com/t5/arcgis-field-maps-questions/featureset-not-working-offline-in-field-maps/td-p/1162899&lt;/A&gt;), but since I am using FeatureSetbyRelationshipName, I am not sure how to fix. In my case 'Well ID' is my GUID field I am using to link to the feature class. Thanks.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 11 Jul 2022 16:53:49 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-field-maps-questions/arcade-pop-up-with-featuresetbyrelationshipname/m-p/1191297#M4074</guid>
      <dc:creator>JeffreyFitzgibbons</dc:creator>
      <dc:date>2022-07-11T16:53:49Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade pop up with FeatureSetByRelationshipName not working offline</title>
      <link>https://community.esri.com/t5/arcgis-field-maps-questions/arcade-pop-up-with-featuresetbyrelationshipname/m-p/1191346#M4075</link>
      <description>&lt;P&gt;If I recall correctly, that FeatureSetByRelationshipName function queries the feature service URL. It does&amp;nbsp;&lt;EM&gt;not&amp;nbsp;&lt;/EM&gt;require the layer to be present in the map, which in an online environment, is one of its benefits.&lt;/P&gt;&lt;P&gt;If you need to work offline, your best bet is to use FeatureSetByName or ID so that you can direct the map to look at already-loaded features in other layers.&lt;/P&gt;</description>
      <pubDate>Mon, 11 Jul 2022 19:47:48 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-field-maps-questions/arcade-pop-up-with-featuresetbyrelationshipname/m-p/1191346#M4075</guid>
      <dc:creator>jcarlson</dc:creator>
      <dc:date>2022-07-11T19:47:48Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade pop up with FeatureSetByRelationshipName not working offline</title>
      <link>https://community.esri.com/t5/arcgis-field-maps-questions/arcade-pop-up-with-featuresetbyrelationshipname/m-p/1191632#M4077</link>
      <description>&lt;P&gt;Thanks for the help. I figured that may be an issue. I changed the expression to the following:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="c"&gt;// first read out the GlobalID of the Feature
var code = $feature["GlobalID"];

// create a sql expression to query on GlobalID
var sql = "Well_ID = '{" + Upper(code) + "}'";
Console(sql);

// access the table
var tbl = FeatureSetByName($datastore,"Gauging_Data");

// filter the table using the sql expression
var relatedrecords = Filter(tbl, sql);

// get a count of the related records
var cnt = Count(relatedrecords);

// initialize a variable that will contain the information to return
var relatedinfo = "Depth_to_Water_ft_BTOC";

// only proceed if you have related records
if (cnt &amp;gt; 0) {
    // sort those records by date descending 
    // change "insp_date" by the date field in your related data
    var sortedrecords = OrderBy(relatedrecords, "Date_and_Time DES");

    // get the first record of the sorted related info
    var latestinfo = First(sortedrecords);
    
    // get the last date and other information if relevant
    relatedinfo = Text(latestinfo["Depth_to_Water_ft_BTOC"]);
    
} else {
    // in case you don't have related info
    relatedinfo = "None available";        
}

// return the result
return relatedinfo&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However, now the issue I am having is the expression isn't working at all online via the field maps mobile app (online or offline), but it works fine in Map Viewer. Is there something I am not understanding about how this expression is supposed to execute?&amp;nbsp;&lt;/P&gt;&lt;P&gt;Also, the error I am getting in Field Maps is:&amp;nbsp;&lt;/P&gt;&lt;P&gt;Expression Name: expr0&lt;BR /&gt;Expression Title: DTW:&lt;BR /&gt;Error Domain: com.esri.arcgis.runtime.services.error&lt;BR /&gt;Error Code: 400&lt;BR /&gt;Error Description: , Unable to perform query. Please check your parameters.&lt;/P&gt;</description>
      <pubDate>Tue, 12 Jul 2022 17:27:15 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-field-maps-questions/arcade-pop-up-with-featuresetbyrelationshipname/m-p/1191632#M4077</guid>
      <dc:creator>JeffreyFitzgibbons</dc:creator>
      <dc:date>2022-07-12T17:27:15Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade pop up with FeatureSetByRelationshipName not working offline</title>
      <link>https://community.esri.com/t5/arcgis-field-maps-questions/arcade-pop-up-with-featuresetbyrelationshipname/m-p/1191875#M4080</link>
      <description>&lt;P&gt;Strange. Does it work in Field Maps if your map is online, or is it not working at all?&lt;/P&gt;&lt;P&gt;Ordinarily, I'd suggest adding&amp;nbsp;&lt;STRONG&gt;Console&lt;/STRONG&gt; messages to the expression, but I don't know if there's a way to view console messages in Field Maps...&lt;/P&gt;</description>
      <pubDate>Wed, 13 Jul 2022 13:29:56 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-field-maps-questions/arcade-pop-up-with-featuresetbyrelationshipname/m-p/1191875#M4080</guid>
      <dc:creator>jcarlson</dc:creator>
      <dc:date>2022-07-13T13:29:56Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade pop up with FeatureSetByRelationshipName not working offline</title>
      <link>https://community.esri.com/t5/arcgis-field-maps-questions/arcade-pop-up-with-featuresetbyrelationshipname/m-p/1193384#M4134</link>
      <description>&lt;P&gt;Yes Relationship by name has some bugs in it - one is a . in the name.&amp;nbsp; Using By Name works better.&amp;nbsp; Search the forum this has been posted a number of times.&lt;/P&gt;</description>
      <pubDate>Tue, 19 Jul 2022 13:46:41 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-field-maps-questions/arcade-pop-up-with-featuresetbyrelationshipname/m-p/1193384#M4134</guid>
      <dc:creator>DougBrowning</dc:creator>
      <dc:date>2022-07-19T13:46:41Z</dc:date>
    </item>
  </channel>
</rss>

