<?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 Arcade and related table strange behavior in ArcGIS Field Maps Questions</title>
    <link>https://community.esri.com/t5/arcgis-field-maps-questions/arcade-and-related-table-strange-behavior/m-p/1409326#M8339</link>
    <description>&lt;DIV class=""&gt;&lt;DIV class=""&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;P&gt;I have a Field Maps application to inventory trees. The application's associated web map has the following features associated with it:&lt;/P&gt;&lt;P&gt;Layers&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;trees&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;Tables&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Maintenance&lt;/LI&gt;&lt;LI&gt;Inspections&lt;/LI&gt;&lt;LI&gt;trees_related&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;I created the '&lt;FONT face="courier new,courier"&gt;trees_related&lt;/FONT&gt;' table to allow for certain fields in the Field Map app to auto-calculate (genus, species, functional group, native/non-native), based on a shared '&lt;FONT face="courier new,courier"&gt;commonname&lt;/FONT&gt;' field. Initially, I had a related table called '&lt;FONT face="courier new,courier"&gt;names_genus_species&lt;/FONT&gt;' that had the same information as trees_related. I preferred the brevity of the name '&lt;FONT face="courier new,courier"&gt;trees_related&lt;/FONT&gt;', so went with that table instead.&lt;/P&gt;&lt;P&gt;Now to my issue: I have four fields in my trees point layer that are auto-calculated based on fields in the related table. Originally, I wrote the expressions to use the '&lt;FONT face="courier new,courier"&gt;names_genus_species&lt;/FONT&gt;' table. All four expressions are structurally identical. The only difference between them is the reference to the relevant field in the related table. For instance, the expression to evaluate for species name:&lt;/P&gt;&lt;PRE&gt;&lt;SPAN class=""&gt;var&lt;/SPAN&gt; related_table = &lt;SPAN class=""&gt;FeatureSetByName&lt;/SPAN&gt;($datastore, &lt;SPAN class=""&gt;"names_genus_species"&lt;/SPAN&gt;, [&lt;SPAN class=""&gt;"commonname"&lt;/SPAN&gt;, &lt;SPAN class=""&gt;"species"&lt;/SPAN&gt;], &lt;SPAN class=""&gt;true&lt;/SPAN&gt;);
&lt;SPAN class=""&gt;var&lt;/SPAN&gt; common_name = $feature.&lt;SPAN class=""&gt;commonname&lt;/SPAN&gt;;
&lt;SPAN class=""&gt;var&lt;/SPAN&gt; matched_feature = &lt;SPAN class=""&gt;First&lt;/SPAN&gt;(&lt;SPAN class=""&gt;Filter&lt;/SPAN&gt;(related_table, &lt;SPAN class=""&gt;"commonname = @common_name"&lt;/SPAN&gt;));
&lt;SPAN class=""&gt;return&lt;/SPAN&gt; &lt;SPAN class=""&gt;iif&lt;/SPAN&gt;(!&lt;SPAN class=""&gt;IsEmpty&lt;/SPAN&gt;(matched_feature), matched_feature[&lt;SPAN class=""&gt;'species'&lt;/SPAN&gt;], &lt;SPAN class=""&gt;'Unknown'&lt;/SPAN&gt;);

&lt;/PRE&gt;&lt;P&gt;This works fine. It continues to work &lt;EM&gt;despite&lt;/EM&gt; the fact that the '&lt;FONT face="courier new,courier"&gt;names_genus_species&lt;/FONT&gt;' table is NO LONGER part of the web map $datastore. Again, I removed it and replaced it with '&lt;FONT face="courier new,courier"&gt;trees_related&lt;/FONT&gt;'.&lt;/P&gt;&lt;P&gt;However, when I use the same code structure and replace the related table name so that the expression contains the table that &lt;EM&gt;actually&lt;/EM&gt; is part of the $datastore in the web map, the code returns an error. For example, when I run:&lt;/P&gt;&lt;PRE&gt;&lt;SPAN class=""&gt;var&lt;/SPAN&gt; related_table = &lt;SPAN class=""&gt;FeatureSetByName&lt;/SPAN&gt;($datastore, &lt;SPAN class=""&gt;"trees_related"&lt;/SPAN&gt;, [&lt;SPAN class=""&gt;"commonname"&lt;/SPAN&gt;, &lt;SPAN class=""&gt;"species"&lt;/SPAN&gt;], &lt;SPAN class=""&gt;true&lt;/SPAN&gt;);
&lt;SPAN class=""&gt;var&lt;/SPAN&gt; common_name = $feature.&lt;SPAN class=""&gt;commonname&lt;/SPAN&gt;;
&lt;SPAN class=""&gt;var&lt;/SPAN&gt; matched_features = First(&lt;SPAN class=""&gt;Filter&lt;/SPAN&gt;(related_table, &lt;SPAN class=""&gt;"commonname = @common_name"&lt;/SPAN&gt;));
&lt;SPAN class=""&gt;return&lt;/SPAN&gt; &lt;SPAN class=""&gt;iif&lt;/SPAN&gt;(!&lt;SPAN class=""&gt;IsEmpty&lt;/SPAN&gt;(matched_feature), matched_feature[&lt;SPAN class=""&gt;'species'&lt;/SPAN&gt;], &lt;SPAN class=""&gt;'Unknown'&lt;/SPAN&gt;);

&lt;/PRE&gt;&lt;P&gt;I am met with this error: &lt;FONT face="courier new,courier"&gt;Test execution error: Execution error - Invalid parameter. Verify test data.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;I am bewildered and would greatly appreciate guidance from anyone who better understands what might be going on here.&lt;/P&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
    <pubDate>Sat, 13 Apr 2024 15:16:54 GMT</pubDate>
    <dc:creator>CameronAndrew</dc:creator>
    <dc:date>2024-04-13T15:16:54Z</dc:date>
    <item>
      <title>Arcade and related table strange behavior</title>
      <link>https://community.esri.com/t5/arcgis-field-maps-questions/arcade-and-related-table-strange-behavior/m-p/1409326#M8339</link>
      <description>&lt;DIV class=""&gt;&lt;DIV class=""&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;P&gt;I have a Field Maps application to inventory trees. The application's associated web map has the following features associated with it:&lt;/P&gt;&lt;P&gt;Layers&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;trees&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;Tables&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Maintenance&lt;/LI&gt;&lt;LI&gt;Inspections&lt;/LI&gt;&lt;LI&gt;trees_related&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;I created the '&lt;FONT face="courier new,courier"&gt;trees_related&lt;/FONT&gt;' table to allow for certain fields in the Field Map app to auto-calculate (genus, species, functional group, native/non-native), based on a shared '&lt;FONT face="courier new,courier"&gt;commonname&lt;/FONT&gt;' field. Initially, I had a related table called '&lt;FONT face="courier new,courier"&gt;names_genus_species&lt;/FONT&gt;' that had the same information as trees_related. I preferred the brevity of the name '&lt;FONT face="courier new,courier"&gt;trees_related&lt;/FONT&gt;', so went with that table instead.&lt;/P&gt;&lt;P&gt;Now to my issue: I have four fields in my trees point layer that are auto-calculated based on fields in the related table. Originally, I wrote the expressions to use the '&lt;FONT face="courier new,courier"&gt;names_genus_species&lt;/FONT&gt;' table. All four expressions are structurally identical. The only difference between them is the reference to the relevant field in the related table. For instance, the expression to evaluate for species name:&lt;/P&gt;&lt;PRE&gt;&lt;SPAN class=""&gt;var&lt;/SPAN&gt; related_table = &lt;SPAN class=""&gt;FeatureSetByName&lt;/SPAN&gt;($datastore, &lt;SPAN class=""&gt;"names_genus_species"&lt;/SPAN&gt;, [&lt;SPAN class=""&gt;"commonname"&lt;/SPAN&gt;, &lt;SPAN class=""&gt;"species"&lt;/SPAN&gt;], &lt;SPAN class=""&gt;true&lt;/SPAN&gt;);
&lt;SPAN class=""&gt;var&lt;/SPAN&gt; common_name = $feature.&lt;SPAN class=""&gt;commonname&lt;/SPAN&gt;;
&lt;SPAN class=""&gt;var&lt;/SPAN&gt; matched_feature = &lt;SPAN class=""&gt;First&lt;/SPAN&gt;(&lt;SPAN class=""&gt;Filter&lt;/SPAN&gt;(related_table, &lt;SPAN class=""&gt;"commonname = @common_name"&lt;/SPAN&gt;));
&lt;SPAN class=""&gt;return&lt;/SPAN&gt; &lt;SPAN class=""&gt;iif&lt;/SPAN&gt;(!&lt;SPAN class=""&gt;IsEmpty&lt;/SPAN&gt;(matched_feature), matched_feature[&lt;SPAN class=""&gt;'species'&lt;/SPAN&gt;], &lt;SPAN class=""&gt;'Unknown'&lt;/SPAN&gt;);

&lt;/PRE&gt;&lt;P&gt;This works fine. It continues to work &lt;EM&gt;despite&lt;/EM&gt; the fact that the '&lt;FONT face="courier new,courier"&gt;names_genus_species&lt;/FONT&gt;' table is NO LONGER part of the web map $datastore. Again, I removed it and replaced it with '&lt;FONT face="courier new,courier"&gt;trees_related&lt;/FONT&gt;'.&lt;/P&gt;&lt;P&gt;However, when I use the same code structure and replace the related table name so that the expression contains the table that &lt;EM&gt;actually&lt;/EM&gt; is part of the $datastore in the web map, the code returns an error. For example, when I run:&lt;/P&gt;&lt;PRE&gt;&lt;SPAN class=""&gt;var&lt;/SPAN&gt; related_table = &lt;SPAN class=""&gt;FeatureSetByName&lt;/SPAN&gt;($datastore, &lt;SPAN class=""&gt;"trees_related"&lt;/SPAN&gt;, [&lt;SPAN class=""&gt;"commonname"&lt;/SPAN&gt;, &lt;SPAN class=""&gt;"species"&lt;/SPAN&gt;], &lt;SPAN class=""&gt;true&lt;/SPAN&gt;);
&lt;SPAN class=""&gt;var&lt;/SPAN&gt; common_name = $feature.&lt;SPAN class=""&gt;commonname&lt;/SPAN&gt;;
&lt;SPAN class=""&gt;var&lt;/SPAN&gt; matched_features = First(&lt;SPAN class=""&gt;Filter&lt;/SPAN&gt;(related_table, &lt;SPAN class=""&gt;"commonname = @common_name"&lt;/SPAN&gt;));
&lt;SPAN class=""&gt;return&lt;/SPAN&gt; &lt;SPAN class=""&gt;iif&lt;/SPAN&gt;(!&lt;SPAN class=""&gt;IsEmpty&lt;/SPAN&gt;(matched_feature), matched_feature[&lt;SPAN class=""&gt;'species'&lt;/SPAN&gt;], &lt;SPAN class=""&gt;'Unknown'&lt;/SPAN&gt;);

&lt;/PRE&gt;&lt;P&gt;I am met with this error: &lt;FONT face="courier new,courier"&gt;Test execution error: Execution error - Invalid parameter. Verify test data.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;I am bewildered and would greatly appreciate guidance from anyone who better understands what might be going on here.&lt;/P&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Sat, 13 Apr 2024 15:16:54 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-field-maps-questions/arcade-and-related-table-strange-behavior/m-p/1409326#M8339</guid>
      <dc:creator>CameronAndrew</dc:creator>
      <dc:date>2024-04-13T15:16:54Z</dc:date>
    </item>
    <item>
      <title>Betreff: Arcade and related table strange behavior</title>
      <link>https://community.esri.com/t5/arcgis-field-maps-questions/arcade-and-related-table-strange-behavior/m-p/1409387#M8340</link>
      <description>are your data in ArcGIS online or Enterprise and if Enterprise in an Enterprise geodatabase and are published referenced or in a copy?&lt;BR /&gt;&lt;BR /&gt;overwriting the service didn't fix the problem?&lt;BR /&gt;&lt;BR /&gt;how is the relation between featureclass and tables managed?&lt;BR /&gt;</description>
      <pubDate>Sun, 14 Apr 2024 13:13:24 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-field-maps-questions/arcade-and-related-table-strange-behavior/m-p/1409387#M8340</guid>
      <dc:creator>HannesVogel</dc:creator>
      <dc:date>2024-04-14T13:13:24Z</dc:date>
    </item>
  </channel>
</rss>

