<?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: Autopopulating fields from a related table using Arcade in ArcGIS Field Maps Questions</title>
    <link>https://community.esri.com/t5/arcgis-field-maps-questions/autopopulating-fields-from-a-related-table-using/m-p/1277361#M5730</link>
    <description>&lt;P&gt;Thanks&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/16421"&gt;@DougBrowning&lt;/a&gt;,&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is what I have so far. I ended up using FeatureSetByName.&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="c"&gt;var related = FeatureSetByName($map, "pointlayer - points");
var uniqueid = $feature.uniqueid;
var relatedRecord = null;
if (uniqueid == '111111') {
relatedRecord = First(Filter(related, "uniqueid = '111111'"));
if (relatedRecord != null) {
return relatedRecord['Field1'];
}
} else if (uniqueid == '222222') {
relatedRecord = First(Filter(related, "uniqueid = '222222'"));
if (relatedRecord != null) {
return relatedRecord['Field1'];
}
}
return null;&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;So far this works and it auto populates the information from the related table Field1 into Field1 in the parent layer. I cant figure out how to return other fields at the same time. For example, I have the Field1, Field2, Field3, etc, that I would like to auto populate into the parent layer. Do you have any ideas as to how I can include these as well?&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks.&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 11 Apr 2023 15:43:11 GMT</pubDate>
    <dc:creator>DaveK</dc:creator>
    <dc:date>2023-04-11T15:43:11Z</dc:date>
    <item>
      <title>Autopopulating fields from a related table using Arcade</title>
      <link>https://community.esri.com/t5/arcgis-field-maps-questions/autopopulating-fields-from-a-related-table-using/m-p/1277315#M5720</link>
      <description>&lt;P&gt;Hello!&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm creating a Field Maps collection form which includes a parent point layer as well as a related table. The parent point layer contains a UniqueID field which is a domain that the user will select. Is it possible to auto populate the remaining fields in the parent table from the information in the related table based on the UniqueID chosen? I think the "Fetch an attribute form a related table" from this page -&amp;nbsp;&lt;A href="https://www.esri.com/arcgis-blog/products/field-maps/field-mobility/common-calculated-expressions-for-arcgis-field-maps/" target="_blank"&gt;https://www.esri.com/arcgis-blog/products/field-maps/field-mobility/common-calculated-expressions-for-arcgis-field-maps/&lt;/A&gt;&amp;nbsp;is the closest to what I'm looking for. Instead of populating the related table from the parent, I would like to auto populate the parent layer from the related table.&amp;nbsp;&lt;SPAN&gt;Any help is appreciated.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Thanks.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 11 Apr 2023 14:39:21 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-field-maps-questions/autopopulating-fields-from-a-related-table-using/m-p/1277315#M5720</guid>
      <dc:creator>DaveK</dc:creator>
      <dc:date>2023-04-11T14:39:21Z</dc:date>
    </item>
    <item>
      <title>Re: Autopopulating fields from a related table using Arcade</title>
      <link>https://community.esri.com/t5/arcgis-field-maps-questions/autopopulating-fields-from-a-related-table-using/m-p/1277335#M5724</link>
      <description>&lt;P&gt;What you want is the FeatureSet function like this&lt;/P&gt;&lt;P&gt;var tbl = FeatureSetByRelationshipName($feature, "Points", ['DesignLat'], false);&lt;BR /&gt;return First(tbl).DesignLat&lt;/P&gt;&lt;P&gt;Hope that helps&lt;/P&gt;</description>
      <pubDate>Tue, 11 Apr 2023 15:08:38 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-field-maps-questions/autopopulating-fields-from-a-related-table-using/m-p/1277335#M5724</guid>
      <dc:creator>DougBrowning</dc:creator>
      <dc:date>2023-04-11T15:08:38Z</dc:date>
    </item>
    <item>
      <title>Re: Autopopulating fields from a related table using Arcade</title>
      <link>https://community.esri.com/t5/arcgis-field-maps-questions/autopopulating-fields-from-a-related-table-using/m-p/1277339#M5726</link>
      <description>&lt;P&gt;Depending on how complex it is, another option would be to just calculate the values in the form for the remaining fields based on what is chosen for UniqueID.&lt;/P&gt;&lt;P&gt;R_&lt;/P&gt;</description>
      <pubDate>Tue, 11 Apr 2023 15:13:40 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-field-maps-questions/autopopulating-fields-from-a-related-table-using/m-p/1277339#M5726</guid>
      <dc:creator>RhettZufelt</dc:creator>
      <dc:date>2023-04-11T15:13:40Z</dc:date>
    </item>
    <item>
      <title>Re: Autopopulating fields from a related table using Arcade</title>
      <link>https://community.esri.com/t5/arcgis-field-maps-questions/autopopulating-fields-from-a-related-table-using/m-p/1277361#M5730</link>
      <description>&lt;P&gt;Thanks&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/16421"&gt;@DougBrowning&lt;/a&gt;,&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is what I have so far. I ended up using FeatureSetByName.&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="c"&gt;var related = FeatureSetByName($map, "pointlayer - points");
var uniqueid = $feature.uniqueid;
var relatedRecord = null;
if (uniqueid == '111111') {
relatedRecord = First(Filter(related, "uniqueid = '111111'"));
if (relatedRecord != null) {
return relatedRecord['Field1'];
}
} else if (uniqueid == '222222') {
relatedRecord = First(Filter(related, "uniqueid = '222222'"));
if (relatedRecord != null) {
return relatedRecord['Field1'];
}
}
return null;&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;So far this works and it auto populates the information from the related table Field1 into Field1 in the parent layer. I cant figure out how to return other fields at the same time. For example, I have the Field1, Field2, Field3, etc, that I would like to auto populate into the parent layer. Do you have any ideas as to how I can include these as well?&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 11 Apr 2023 15:43:11 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-field-maps-questions/autopopulating-fields-from-a-related-table-using/m-p/1277361#M5730</guid>
      <dc:creator>DaveK</dc:creator>
      <dc:date>2023-04-11T15:43:11Z</dc:date>
    </item>
    <item>
      <title>Re: Autopopulating fields from a related table using Arcade</title>
      <link>https://community.esri.com/t5/arcgis-field-maps-questions/autopopulating-fields-from-a-related-table-using/m-p/1277374#M5732</link>
      <description>&lt;P&gt;No you would need to do this for each field.&amp;nbsp; I have upwards of 32 to populate all of mine.&amp;nbsp; Well you could return them but you cannot store all that in one field so not sure what you mean.&lt;/P&gt;&lt;P&gt;Add the specific field you want and add the false part to not return the geometry and it will be faster like in my example.&amp;nbsp; I am not sure why you are hard coding in the 1111 thing vs just calling by name but I guess you have a reason.&lt;/P&gt;</description>
      <pubDate>Tue, 11 Apr 2023 15:53:49 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-field-maps-questions/autopopulating-fields-from-a-related-table-using/m-p/1277374#M5732</guid>
      <dc:creator>DougBrowning</dc:creator>
      <dc:date>2023-04-11T15:53:49Z</dc:date>
    </item>
    <item>
      <title>Re: Autopopulating fields from a related table using Arcade</title>
      <link>https://community.esri.com/t5/arcgis-field-maps-questions/autopopulating-fields-from-a-related-table-using/m-p/1277375#M5733</link>
      <description>&lt;P&gt;You can simplify this by using the UniqueID directly in your filter&lt;/P&gt;&lt;LI-CODE lang="c"&gt;var related = FeatureSetByName($map, "pointlayer - points");
var uid = $feature.uniqueid;
var relatedRecord = null;
relatedRecord = First(Filter(related, "uniqueid = @uid"));
if (relatedRecord != null) return relatedRecord['Field1'];
return null;&lt;/LI-CODE&gt;</description>
      <pubDate>Tue, 11 Apr 2023 15:56:47 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-field-maps-questions/autopopulating-fields-from-a-related-table-using/m-p/1277375#M5733</guid>
      <dc:creator>KenBuja</dc:creator>
      <dc:date>2023-04-11T15:56:47Z</dc:date>
    </item>
    <item>
      <title>Re: Autopopulating fields from a related table using Arcade</title>
      <link>https://community.esri.com/t5/arcgis-field-maps-questions/autopopulating-fields-from-a-related-table-using/m-p/1277420#M5736</link>
      <description>&lt;P&gt;Thanks&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/2839"&gt;@KenBuja&lt;/a&gt;&amp;nbsp;this helped!&lt;/P&gt;</description>
      <pubDate>Tue, 11 Apr 2023 16:53:32 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-field-maps-questions/autopopulating-fields-from-a-related-table-using/m-p/1277420#M5736</guid>
      <dc:creator>DaveK</dc:creator>
      <dc:date>2023-04-11T16:53:32Z</dc:date>
    </item>
    <item>
      <title>Re: Autopopulating fields from a related table using Arcade</title>
      <link>https://community.esri.com/t5/arcgis-field-maps-questions/autopopulating-fields-from-a-related-table-using/m-p/1352537#M7433</link>
      <description>&lt;P&gt;Hi Doug,&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a very similar issue but just different enough so that the solution provided isn't quite the fix I need. I am trying to calculate all the values in a field based on the values from another field in a related table. Here's the set-up. The parent table Sewer_Lines contains PipeLengths for all of our sewer lines. We have a related table for flushing these lines that records each time the line is cleaned which also contains PipeLengh. Since we've already been keeping a flushing record for some time now, I'd like to have the PipeLength(s) from Sewer_Lines calculated into PipeLength(s) in the Sewer_Lines_Flushings table.&amp;nbsp; I am able to get the values this way&lt;/P&gt;&lt;P&gt;var flushlen = FeatureSetByName($datastore, "Sewer_Lines", ['PipeLength'])&lt;BR /&gt;flushlen&lt;/P&gt;&lt;P&gt;But this also returns the OBJECTID field, not just PipeLength. I've also tried this&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;var flushlen = FeatureSetByName($datastore,"Sewer_Lines", ['PipeLength'])&lt;BR /&gt;var feature =First(flushlen)&lt;BR /&gt;if (!IsEmpty(feature)) {&lt;BR /&gt;return feature['PipeLength']&lt;BR /&gt;} else {&lt;BR /&gt;return 0&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;But it returns just the first record in the parent table and not all of the records. Is there a way to update all of the records in Sewer_Lines_Flushings.PipeLength based on Sewer_Lines.PipeLength?&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>Wed, 22 Nov 2023 14:41:46 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-field-maps-questions/autopopulating-fields-from-a-related-table-using/m-p/1352537#M7433</guid>
      <dc:creator>ErikWalling</dc:creator>
      <dc:date>2023-11-22T14:41:46Z</dc:date>
    </item>
    <item>
      <title>Re: Autopopulating fields from a related table using Arcade</title>
      <link>https://community.esri.com/t5/arcgis-field-maps-questions/autopopulating-fields-from-a-related-table-using/m-p/1352549#M7434</link>
      <description>&lt;P&gt;Not sure what you mean by all the values into a field.&amp;nbsp; You can't have multiple values in one field.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If you mean just create a string of values from the repeats then you do that by making a string in a loop like shown in this post.&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.esri.com/t5/arcgis-pro-questions/arcade-array-output-from-related-table-help/td-p/1139909" target="_blank"&gt;https://community.esri.com/t5/arcgis-pro-questions/arcade-array-output-from-related-table-help/td-p/1139909&lt;/A&gt;&lt;/P&gt;&lt;P&gt;If you just want to display the repeat values then the new map viewer can do this for up to 10 records.&lt;/P&gt;&lt;P&gt;I think there is a way to display a table also but I forget.&lt;/P&gt;&lt;P&gt;Hope that helps&lt;/P&gt;</description>
      <pubDate>Wed, 22 Nov 2023 14:57:38 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-field-maps-questions/autopopulating-fields-from-a-related-table-using/m-p/1352549#M7434</guid>
      <dc:creator>DougBrowning</dc:creator>
      <dc:date>2023-11-22T14:57:38Z</dc:date>
    </item>
    <item>
      <title>Re: Autopopulating fields from a related table using Arcade</title>
      <link>https://community.esri.com/t5/arcgis-field-maps-questions/autopopulating-fields-from-a-related-table-using/m-p/1387322#M8009</link>
      <description>&lt;P&gt;Hi again,&lt;/P&gt;&lt;P&gt;I am trying to get this to work and have tried many variations without success, do you have any suggestions?&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;var&lt;/SPAN&gt; &lt;SPAN&gt;x&lt;/SPAN&gt;&lt;SPAN&gt; = (&lt;/SPAN&gt;&lt;SPAN&gt;$feature&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;Scum&lt;/SPAN&gt;&lt;SPAN&gt; + &lt;/SPAN&gt;&lt;SPAN&gt;$feature&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;Sludge&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;var&lt;/SPAN&gt; &lt;SPAN&gt;y&lt;/SPAN&gt;&lt;SPAN&gt; = &lt;/SPAN&gt;&lt;SPAN&gt;FeatureSetByRelationshipName&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;$feature&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;SPAN&gt;"MPCVRS"&lt;/SPAN&gt;&lt;SPAN&gt;, [&lt;/SPAN&gt;&lt;SPAN&gt;'LiquidDepth'&lt;/SPAN&gt;&lt;SPAN&gt;], False)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt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to FieldMaps to test. I am trying to calculate&amp;nbsp; capacity (sludge depth + scum depth / liquid depth). My result for var x is what I expect but z seems to want to bring along object ID and not just the value for liquid depth. The other potential issue is scum and sludge depth is being provided by user input in the form but the form seems to run the calculation as soon as the form is opened rather than after user input.... Is there a way to change that or some other work around you're aware of? I should note that capacity does not need to be calculated in the form necessarily. The other way I could do this is in the main table and possibly in the pop-up but I am not sure if that type of expression would be allowed in the pop-up or if that's more for formatting text....&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Tue, 27 Feb 2024 13:22:02 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-field-maps-questions/autopopulating-fields-from-a-related-table-using/m-p/1387322#M8009</guid>
      <dc:creator>ErikWalling</dc:creator>
      <dc:date>2024-02-27T13:22:02Z</dc:date>
    </item>
    <item>
      <title>Re: Autopopulating fields from a related table using Arcade</title>
      <link>https://community.esri.com/t5/arcgis-field-maps-questions/autopopulating-fields-from-a-related-table-using/m-p/1390534#M8041</link>
      <description>&lt;P&gt;I your First you need to give a field name.&amp;nbsp; &amp;nbsp;Like this&lt;/P&gt;&lt;P&gt;var tbl = FeatureSetByRelationshipName($feature, "Points", ['DesignLat'], false);&lt;BR /&gt;return First(tbl).DesignLat&lt;/P&gt;&lt;P&gt;Also First will fail if it is null so if I remember right you need to something like this.&lt;/P&gt;&lt;DIV&gt;&lt;SPAN&gt;var&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;x&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;= (&lt;/SPAN&gt;&lt;SPAN&gt;$feature&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;Scum&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;+&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;$feature&lt;/SPAN&gt;&lt;SPAN&gt;.&l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&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Syntax may be off but you get the idea I hope.&lt;/SPAN&gt;&lt;/DIV&gt;</description>
      <pubDate>Mon, 04 Mar 2024 17:23:03 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-field-maps-questions/autopopulating-fields-from-a-related-table-using/m-p/1390534#M8041</guid>
      <dc:creator>DougBrowning</dc:creator>
      <dc:date>2024-03-04T17:23:03Z</dc:date>
    </item>
    <item>
      <title>Re: Autopopulating fields from a related table using Arcade</title>
      <link>https://community.esri.com/t5/arcgis-field-maps-questions/autopopulating-fields-from-a-related-table-using/m-p/1399118#M8169</link>
      <description>&lt;P&gt;Thank you for the insights! I think I finally beat this into submission. For one thing I had the wrong data type for calculating a decimal number so that definitely helped but this is what I ended up with.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;var&lt;/SPAN&gt; &lt;SPAN&gt;a&lt;/SPAN&gt;&lt;SPAN&gt; = &lt;/SPAN&gt;&lt;SPAN&gt;$feature&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;Scum&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;var&lt;/SPAN&gt; &lt;SPAN&gt;b&lt;/SPAN&gt;&lt;SPAN&gt; = &lt;/SPAN&gt;&lt;SPAN&gt;$feature&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;Sludge&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;var&lt;/SPAN&gt; &lt;SPAN&gt;c&lt;/SPAN&gt;&lt;SPAN&gt; = &lt;/SPAN&gt;&lt;SPAN&gt;$feature&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;LiquidDepth&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;var&lt;/SPAN&gt; &lt;SPAN&gt;d&lt;/SPAN&gt;&lt;SPAN&gt; = ((&lt;/SPAN&gt;&lt;SPAN&gt;a&lt;/SPAN&gt;&lt;SPAN&gt; + &lt;/SPAN&gt;&lt;SPAN&gt;b&lt;/SPAN&gt;&lt;SPAN&gt;) / &lt;/SPAN&gt;&lt;SPAN&gt;c&lt;/SPAN&gt;&lt;SPAN&gt;) * &lt;/SPAN&gt;&lt;SPAN&gt;100&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;IIf&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;c&lt;/SPAN&gt;&lt;SPAN&gt; == &lt;/SPAN&gt;&lt;SPAN&gt;0&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;0&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;d&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Thu, 21 Mar 2024 16:41:11 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-field-maps-questions/autopopulating-fields-from-a-related-table-using/m-p/1399118#M8169</guid>
      <dc:creator>ErikWalling</dc:creator>
      <dc:date>2024-03-21T16:41:11Z</dc:date>
    </item>
    <item>
      <title>Re: Autopopulating fields from a related table using Arcade</title>
      <link>https://community.esri.com/t5/arcgis-field-maps-questions/autopopulating-fields-from-a-related-table-using/m-p/1399125#M8170</link>
      <description>&lt;P&gt;Pretty sure this would crash on var d if c =0 since you are checking it after the fact.&lt;/P&gt;&lt;P&gt;I would do more like&amp;nbsp;&lt;/P&gt;&lt;P&gt;iif (&lt;SPAN&gt;$feature&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;LiquidDepth == 0, 0, (($feature.Scum +&amp;nbsp;$feature.Sludge) /&amp;nbsp;$feature.LiquidDepth) * 100)&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 21 Mar 2024 16:50:44 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-field-maps-questions/autopopulating-fields-from-a-related-table-using/m-p/1399125#M8170</guid>
      <dc:creator>DougBrowning</dc:creator>
      <dc:date>2024-03-21T16:50:44Z</dc:date>
    </item>
    <item>
      <title>Re: Autopopulating fields from a related table using Arcade</title>
      <link>https://community.esri.com/t5/arcgis-field-maps-questions/autopopulating-fields-from-a-related-table-using/m-p/1400277#M8183</link>
      <description>&lt;P&gt;Surprisingly this actually works as is. The variable "d" does not evaluate to 'true' unless variable "c" is not equal to zero. I kept getting a result of infinity which I believe was due to the calculation trying to divide by zero.&amp;nbsp;&lt;/P&gt;&lt;P&gt;In the form liquid depth is pulled from the main table using:&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;var&lt;/SPAN&gt; &lt;SPAN&gt;x&lt;/SPAN&gt;&lt;SPAN&gt; = &lt;/SPAN&gt;&lt;SPAN&gt;FeatureSetByRelationshipName&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;$feature&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;SPAN&gt;"MPCVRS"&lt;/SPAN&gt;&lt;SPAN&gt;, [&lt;/SPAN&gt;&lt;SPAN&gt;'LiquidDepth'&lt;/SPAN&gt;&lt;SPAN&gt;])&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;var&lt;/SPAN&gt; &lt;SPAN&gt;y&lt;/SPAN&gt;&lt;SPAN&gt; =&lt;/SPAN&gt;&lt;SPAN&gt;First&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;x&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;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t;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;var&lt;/SPAN&gt; &lt;SPAN&gt;a&lt;/SPAN&gt;&lt;SPAN&gt; = &lt;/SPAN&gt;&lt;SPAN&gt;$feature&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;CalcCap&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;IIf&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;a&lt;/SPAN&gt;&lt;SPAN&gt; &amp;gt; &lt;/SPAN&gt;&lt;SPAN&gt;33.0&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;"YES"&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;"NO"&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;to determine if the tank needs to be pumped or not returning domain values "YES" or "NO"&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;I've successfully tested this multiple times through field maps.&amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Mon, 25 Mar 2024 11:33:17 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-field-maps-questions/autopopulating-fields-from-a-related-table-using/m-p/1400277#M8183</guid>
      <dc:creator>ErikWalling</dc:creator>
      <dc:date>2024-03-25T11:33:17Z</dc:date>
    </item>
    <item>
      <title>Re: Autopopulating fields from a related table using Arcade</title>
      <link>https://community.esri.com/t5/arcgis-field-maps-questions/autopopulating-fields-from-a-related-table-using/m-p/1400330#M8185</link>
      <description>&lt;P&gt;It may be trying to help you by working but I would not do it that way.&amp;nbsp; Never want code that divides by 0.&amp;nbsp; Its as easy fix so why not.&lt;/P&gt;&lt;P&gt;If I remember right&amp;nbsp;&lt;SPAN&gt;var&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;y&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;=&lt;/SPAN&gt;&lt;SPAN&gt;First&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;x&lt;/SPAN&gt;&lt;SPAN&gt;) will also fail if x is empty&amp;nbsp; You need to check x for being empty first.&lt;/SPAN&gt;&lt;/P&gt;&lt;DIV&gt;&lt;SPAN&gt;var&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;x&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;=&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;FeatureSetByRelationshipName&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;$feature&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;SPAN&gt;"MPCVRS"&lt;/SPAN&gt;&lt;SPAN&gt;, [&lt;/SPAN&gt;&lt;SPAN&gt;'LiquidDepth'&lt;/SPAN&gt;&lt;SPAN&gt;], false);&amp;nbsp; //faster to not return geo&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;if&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;(!&lt;/SPAN&gt;&lt;SPAN&gt;IsEmpty&lt;/SPAN&gt;&lt;SPAN&gt;(x&lt;/SPAN&gt;&lt;SPAN&gt;)) {&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;return&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;First(x)&lt;/SPAN&gt;&lt;SPAN&gt;[&lt;/SPAN&gt;&lt;SPAN&gt;'LiquidDepth'&lt;/SPAN&gt;&lt;SPAN&gt;]&amp;nbsp; &amp;nbsp; &amp;nbsp; // or&amp;nbsp;First(x).LiquidDepth&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;}&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;else&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;{&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;return&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;null&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;/DIV&gt;</description>
      <pubDate>Mon, 25 Mar 2024 13:53:01 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-field-maps-questions/autopopulating-fields-from-a-related-table-using/m-p/1400330#M8185</guid>
      <dc:creator>DougBrowning</dc:creator>
      <dc:date>2024-03-25T13:53:01Z</dc:date>
    </item>
    <item>
      <title>Re: Autopopulating fields from a related table using Arcade</title>
      <link>https://community.esri.com/t5/arcgis-field-maps-questions/autopopulating-fields-from-a-related-table-using/m-p/1558159#M9948</link>
      <description>&lt;P&gt;Hello i need help understanding this arcade expression. On the first line "pointlayer" would be the name of the parent layer? Also "points" where is that name coming from?&lt;/P&gt;</description>
      <pubDate>Wed, 13 Nov 2024 17:36:43 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-field-maps-questions/autopopulating-fields-from-a-related-table-using/m-p/1558159#M9948</guid>
      <dc:creator>Krocha</dc:creator>
      <dc:date>2024-11-13T17:36:43Z</dc:date>
    </item>
    <item>
      <title>Re: Autopopulating fields from a related table using Arcade</title>
      <link>https://community.esri.com/t5/arcgis-field-maps-questions/autopopulating-fields-from-a-related-table-using/m-p/1558164#M9949</link>
      <description>&lt;P&gt;Are you doing this expression in field maps designer?&lt;/P&gt;</description>
      <pubDate>Wed, 13 Nov 2024 17:39:17 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-field-maps-questions/autopopulating-fields-from-a-related-table-using/m-p/1558164#M9949</guid>
      <dc:creator>Krocha</dc:creator>
      <dc:date>2024-11-13T17:39:17Z</dc:date>
    </item>
    <item>
      <title>Re: Autopopulating fields from a related table using Arcade</title>
      <link>https://community.esri.com/t5/arcgis-field-maps-questions/autopopulating-fields-from-a-related-table-using/m-p/1558615#M9959</link>
      <description>&lt;P&gt;ByRelationship should be fixed now so you can use that.&lt;/P&gt;&lt;P&gt;FeatureSetByRelationshipName($feature, "Name of the Relationship class", ['list of fields'], false);&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;(the last false is to not return geometry to speed it up.)&lt;/P&gt;</description>
      <pubDate>Thu, 14 Nov 2024 14:39:45 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-field-maps-questions/autopopulating-fields-from-a-related-table-using/m-p/1558615#M9959</guid>
      <dc:creator>DougBrowning</dc:creator>
      <dc:date>2024-11-14T14:39:45Z</dc:date>
    </item>
    <item>
      <title>Re: Autopopulating fields from a related table using Arcade</title>
      <link>https://community.esri.com/t5/arcgis-field-maps-questions/autopopulating-fields-from-a-related-table-using/m-p/1609012#M10782</link>
      <description>&lt;P&gt;I've literally been looking for hours and this is the only solution that worked for me.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 24 Apr 2025 18:41:05 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-field-maps-questions/autopopulating-fields-from-a-related-table-using/m-p/1609012#M10782</guid>
      <dc:creator>EricaNova</dc:creator>
      <dc:date>2025-04-24T18:41:05Z</dc:date>
    </item>
  </channel>
</rss>

