<?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 Attribute rule to calculate GPM field based on flow field in ArcGIS Pro Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-questions/attribute-rule-to-calculate-gpm-field-based-on/m-p/1398656#M80700</link>
    <description>&lt;P&gt;I have the below Arcade set to update a parent fc when an entry is added to the inspection table. Now I need the trigger field to be calculated automatically when the flow field is updated. How can I update my code to include this logic? Parent field is "class", related table trigger field is "GPM", and I need to calculate GPM from the "Flow" field.&amp;nbsp;&lt;/P&gt;&lt;P&gt;var parent_id = $feature.hydrantOBJID ;&lt;BR /&gt;var parent_class = FeatureSetByName($datastore, "Fire.SDE.Hydrants", ["OBJECTID", 'class'], false);&lt;BR /&gt;var parent_records = Filter(parent_class, "OBJECTID = @parent_id");&lt;/P&gt;&lt;P&gt;var updates = [];&lt;BR /&gt;var i = 0;&lt;BR /&gt;var new_value = 'no gpm';&lt;/P&gt;&lt;P&gt;if ($feature.GPM &amp;gt;= 1500) {&lt;BR /&gt;new_value = "Blue - 1500 GPM or Greater";&lt;BR /&gt;}&lt;BR /&gt;else if ($feature.GPM &amp;gt;= 1000) {&lt;BR /&gt;new_value = "Green - 1000-1499 GPM";&lt;BR /&gt;}&lt;BR /&gt;else if ($feature.GPM &amp;gt;= 500){&lt;BR /&gt;new_value = "Orange - 500-999 GPM";&lt;BR /&gt;}&lt;BR /&gt;else {&lt;BR /&gt;new_value = "Red - 0-499 GPM";&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;for (var row in parent_records) {&lt;BR /&gt;// If the parent row is null or has a different value, updated it&lt;BR /&gt;if (IsEmpty(row['class']) || row['class'] != new_value)&lt;BR /&gt;{&lt;BR /&gt;updates[i++] = {&lt;BR /&gt;'OBJECTID': parent_id,&lt;BR /&gt;'attributes': {"class": new_value}&lt;BR /&gt;};&lt;BR /&gt;}&lt;BR /&gt;}&lt;/P&gt;</description>
    <pubDate>Wed, 20 Mar 2024 19:34:17 GMT</pubDate>
    <dc:creator>MikhaylaB</dc:creator>
    <dc:date>2024-03-20T19:34:17Z</dc:date>
    <item>
      <title>Attribute rule to calculate GPM field based on flow field</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/attribute-rule-to-calculate-gpm-field-based-on/m-p/1398656#M80700</link>
      <description>&lt;P&gt;I have the below Arcade set to update a parent fc when an entry is added to the inspection table. Now I need the trigger field to be calculated automatically when the flow field is updated. How can I update my code to include this logic? Parent field is "class", related table trigger field is "GPM", and I need to calculate GPM from the "Flow" field.&amp;nbsp;&lt;/P&gt;&lt;P&gt;var parent_id = $feature.hydrantOBJID ;&lt;BR /&gt;var parent_class = FeatureSetByName($datastore, "Fire.SDE.Hydrants", ["OBJECTID", 'class'], false);&lt;BR /&gt;var parent_records = Filter(parent_class, "OBJECTID = @parent_id");&lt;/P&gt;&lt;P&gt;var updates = [];&lt;BR /&gt;var i = 0;&lt;BR /&gt;var new_value = 'no gpm';&lt;/P&gt;&lt;P&gt;if ($feature.GPM &amp;gt;= 1500) {&lt;BR /&gt;new_value = "Blue - 1500 GPM or Greater";&lt;BR /&gt;}&lt;BR /&gt;else if ($feature.GPM &amp;gt;= 1000) {&lt;BR /&gt;new_value = "Green - 1000-1499 GPM";&lt;BR /&gt;}&lt;BR /&gt;else if ($feature.GPM &amp;gt;= 500){&lt;BR /&gt;new_value = "Orange - 500-999 GPM";&lt;BR /&gt;}&lt;BR /&gt;else {&lt;BR /&gt;new_value = "Red - 0-499 GPM";&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;for (var row in parent_records) {&lt;BR /&gt;// If the parent row is null or has a different value, updated it&lt;BR /&gt;if (IsEmpty(row['class']) || row['class'] != new_value)&lt;BR /&gt;{&lt;BR /&gt;updates[i++] = {&lt;BR /&gt;'OBJECTID': parent_id,&lt;BR /&gt;'attributes': {"class": new_value}&lt;BR /&gt;};&lt;BR /&gt;}&lt;BR /&gt;}&lt;/P&gt;</description>
      <pubDate>Wed, 20 Mar 2024 19:34:17 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/attribute-rule-to-calculate-gpm-field-based-on/m-p/1398656#M80700</guid>
      <dc:creator>MikhaylaB</dc:creator>
      <dc:date>2024-03-20T19:34:17Z</dc:date>
    </item>
  </channel>
</rss>

