<?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: Add Attribute Rule, Help With Arcade Expression (Pass value from Parent to Child, Calculation) in ArcGIS Pro Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-questions/add-attribute-rule-help-with-arcade-expression/m-p/1396662#M80422</link>
    <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/80456"&gt;@ZachBodenner&lt;/a&gt;; That cleared the invalid expression.&amp;nbsp; I now have a valid expression.&amp;nbsp; Thank you.&amp;nbsp; Maybe the First() is for a many to many?&amp;nbsp;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;New problem.&amp;nbsp; The tool runs but fails with this error.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="TylerT_0-1710521213753.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/98189i2EDF3B1C977CC56B/image-size/medium?v=v2&amp;amp;px=400" role="button" title="TylerT_0-1710521213753.png" alt="TylerT_0-1710521213753.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Any ideas about this error?&lt;/P&gt;&lt;P&gt;&amp;lt;snip&amp;gt;&lt;/P&gt;&lt;PRE&gt;ERROR 002764:&lt;SPAN class=""&gt; ERROR: code:500, JSONObject["extent"] not found., Internal server error.&lt;/SPAN&gt;&lt;/PRE&gt;&lt;PRE&gt;&lt;SPAN class=""&gt;Failed to execute (AddAttributeRule).&lt;/SPAN&gt;&lt;/PRE&gt;&lt;PRE&gt;Failed at Friday, 15 March, 2024 12:05:55 (Elapsed Time: 2.81 seconds)&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;A href="https://pro.arcgis.com/en/pro-app/3.1/tool-reference/tool-errors-and-warnings/001001-010000/tool-errors-and-warnings-02751-02775-002764.htm" target="_blank" rel="noopener"&gt;https://pro.arcgis.com/en/pro-app/3.1/tool-reference/tool-errors-and-warnings/001001-010000/tool-errors-and-warnings-02751-02775-002764.htm&lt;/A&gt;&lt;/P&gt;</description>
    <pubDate>Fri, 15 Mar 2024 16:49:17 GMT</pubDate>
    <dc:creator>TylerT</dc:creator>
    <dc:date>2024-03-15T16:49:17Z</dc:date>
    <item>
      <title>Add Attribute Rule, Help With Arcade Expression (Pass value from Parent to Child, Calculation)</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/add-attribute-rule-help-with-arcade-expression/m-p/1396609#M80412</link>
      <description>&lt;P&gt;I am adapting an arcade expression attribute rule by&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/294341"&gt;@JohannesLindner&lt;/a&gt;&amp;nbsp;(&lt;A href="https://community.esri.com/t5/arcgis-pro-questions/attribute-rule-to-pass-a-value-from-parent-to/m-p/1124219#M48859" target="_blank" rel="noopener"&gt;https://community.esri.com/t5/arcgis-pro-questions/attribute-rule-to-pass-a-value-from-parent-to/m-p/1124219#M48859&lt;/A&gt;) where I have a relationship class.&amp;nbsp; Arcade isn't a particular strength and could use an assist debugging.&amp;nbsp; Here is this script and the error.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="TylerT_0-1710517236863.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/98173iA4DA943C4D0FB0A9/image-size/medium?v=v2&amp;amp;px=400" role="button" title="TylerT_0-1710517236863.png" alt="TylerT_0-1710517236863.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;I need to pass a field value (project_pw) from parent to child when children are created.&lt;/P&gt;&lt;P&gt;Any tips would be greatly appreciated.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Tyler&lt;/P&gt;&lt;P&gt;ArcGIS Pro3.2.0&lt;/P&gt;&lt;P&gt;&amp;lt;for copy/paste&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="c"&gt;// by JohannesLindner, &amp;lt;edited&amp;gt;
var parent_fs = FeatureSetByRelationshipName($feature, "t12_projects_rc")
// return nothing if no parent feature was found
var parent = First(parent_fs)
if(parent == null) { return }
return parent.project_pw&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&amp;lt;error&amp;gt;&lt;BR /&gt;Invalid expression.&lt;BR /&gt;Error on line 4.&lt;BR /&gt;Expected array or feature set&lt;/P&gt;</description>
      <pubDate>Fri, 15 Mar 2024 15:52:59 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/add-attribute-rule-help-with-arcade-expression/m-p/1396609#M80412</guid>
      <dc:creator>TylerT</dc:creator>
      <dc:date>2024-03-15T15:52:59Z</dc:date>
    </item>
    <item>
      <title>Re: Add Attribute Rule, Help With Arcade Expression (Pass value from Parent to Child, Calculation)</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/add-attribute-rule-help-with-arcade-expression/m-p/1396627#M80414</link>
      <description>&lt;P&gt;Have you tried removing the First function? I'm wondering if the FeatureSetByRelationshipName is already grabbing only the one parent feature, and thus first would be throwing an error because it's looking for an array (ie multiple things)?&lt;/P&gt;</description>
      <pubDate>Fri, 15 Mar 2024 16:07:49 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/add-attribute-rule-help-with-arcade-expression/m-p/1396627#M80414</guid>
      <dc:creator>ZachBodenner</dc:creator>
      <dc:date>2024-03-15T16:07:49Z</dc:date>
    </item>
    <item>
      <title>Re: Add Attribute Rule, Help With Arcade Expression (Pass value from Parent to Child, Calculation)</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/add-attribute-rule-help-with-arcade-expression/m-p/1396662#M80422</link>
      <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/80456"&gt;@ZachBodenner&lt;/a&gt;; That cleared the invalid expression.&amp;nbsp; I now have a valid expression.&amp;nbsp; Thank you.&amp;nbsp; Maybe the First() is for a many to many?&amp;nbsp;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;New problem.&amp;nbsp; The tool runs but fails with this error.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="TylerT_0-1710521213753.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/98189i2EDF3B1C977CC56B/image-size/medium?v=v2&amp;amp;px=400" role="button" title="TylerT_0-1710521213753.png" alt="TylerT_0-1710521213753.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Any ideas about this error?&lt;/P&gt;&lt;P&gt;&amp;lt;snip&amp;gt;&lt;/P&gt;&lt;PRE&gt;ERROR 002764:&lt;SPAN class=""&gt; ERROR: code:500, JSONObject["extent"] not found., Internal server error.&lt;/SPAN&gt;&lt;/PRE&gt;&lt;PRE&gt;&lt;SPAN class=""&gt;Failed to execute (AddAttributeRule).&lt;/SPAN&gt;&lt;/PRE&gt;&lt;PRE&gt;Failed at Friday, 15 March, 2024 12:05:55 (Elapsed Time: 2.81 seconds)&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;A href="https://pro.arcgis.com/en/pro-app/3.1/tool-reference/tool-errors-and-warnings/001001-010000/tool-errors-and-warnings-02751-02775-002764.htm" target="_blank" rel="noopener"&gt;https://pro.arcgis.com/en/pro-app/3.1/tool-reference/tool-errors-and-warnings/001001-010000/tool-errors-and-warnings-02751-02775-002764.htm&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 15 Mar 2024 16:49:17 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/add-attribute-rule-help-with-arcade-expression/m-p/1396662#M80422</guid>
      <dc:creator>TylerT</dc:creator>
      <dc:date>2024-03-15T16:49:17Z</dc:date>
    </item>
    <item>
      <title>Re: Add Attribute Rule, Help With Arcade Expression (Pass value from Parent to Child, Calculation)</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/add-attribute-rule-help-with-arcade-expression/m-p/1396667#M80425</link>
      <description>&lt;P&gt;To me this looks like it's related to the actual data you're dealing with. Can you talk a little about the databases your data is coming from? What kind of files are they (feature class and geodatabse table?)&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 15 Mar 2024 16:58:12 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/add-attribute-rule-help-with-arcade-expression/m-p/1396667#M80425</guid>
      <dc:creator>ZachBodenner</dc:creator>
      <dc:date>2024-03-15T16:58:12Z</dc:date>
    </item>
    <item>
      <title>Re: Add Attribute Rule, Help With Arcade Expression (Pass value from Parent to Child, Calculation)</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/add-attribute-rule-help-with-arcade-expression/m-p/1396671#M80427</link>
      <description>&lt;P&gt;The Parent is a hosted Feature Service Feature Class (polygon) on ArcGIS Enterprise Portal.&amp;nbsp; The Child is a hosted Feature Service Table.&amp;nbsp; They are related by a 1:M feature class.&lt;/P&gt;&lt;P&gt;The field I want to pass from Parent to Child is a text field (basically project number).&amp;nbsp; Some Parent fields are null.&amp;nbsp; The desire triggers are insert and update.&lt;/P&gt;</description>
      <pubDate>Fri, 15 Mar 2024 17:07:43 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/add-attribute-rule-help-with-arcade-expression/m-p/1396671#M80427</guid>
      <dc:creator>TylerT</dc:creator>
      <dc:date>2024-03-15T17:07:43Z</dc:date>
    </item>
    <item>
      <title>Re: Add Attribute Rule, Help With Arcade Expression (Pass value from Parent to Child, Calculation)</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/add-attribute-rule-help-with-arcade-expression/m-p/1396716#M80437</link>
      <description>&lt;P&gt;Ah, that might be the issue. Based on previous entries on the community, Hosted services cannot have attribute rules applied:&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.esri.com/t5/attribute-rules-questions/can-attribute-rules-be-used-on-feature-service/td-p/1265867#:~:text=Attribute%20rules%20are%20not%20supported,to%20use%20an%20enterprise%20GDB" target="_blank"&gt;https://community.esri.com/t5/attribute-rules-questions/can-attribute-rules-be-used-on-feature-service/td-p/1265867#:~:text=Attribute%20rules%20are%20not%20supported,to%20use%20an%20enterprise%20GDB&lt;/A&gt;.&lt;/P&gt;&lt;P&gt;Though I would also suggest marking the removal of the First function as a solution since it solved the Arcade error you were getting.&lt;/P&gt;</description>
      <pubDate>Fri, 15 Mar 2024 18:04:32 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/add-attribute-rule-help-with-arcade-expression/m-p/1396716#M80437</guid>
      <dc:creator>ZachBodenner</dc:creator>
      <dc:date>2024-03-15T18:04:32Z</dc:date>
    </item>
    <item>
      <title>Re: Add Attribute Rule, Help With Arcade Expression (Pass value from Parent to Child, Calculation)</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/add-attribute-rule-help-with-arcade-expression/m-p/1397848#M80618</link>
      <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/80456"&gt;@ZachBodenner&lt;/a&gt;&amp;nbsp;, It seems you are correct that attribute rules are not supported in hosted feature classes.&amp;nbsp; Interesting.&amp;nbsp; Thank you.&lt;/P&gt;</description>
      <pubDate>Tue, 19 Mar 2024 14:18:00 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/add-attribute-rule-help-with-arcade-expression/m-p/1397848#M80618</guid>
      <dc:creator>TylerT</dc:creator>
      <dc:date>2024-03-19T14:18:00Z</dc:date>
    </item>
    <item>
      <title>Re: Add Attribute Rule, Help With Arcade Expression (Pass value from Parent to Child, Calculation)</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/add-attribute-rule-help-with-arcade-expression/m-p/1398095#M80637</link>
      <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/80456"&gt;@ZachBodenner&lt;/a&gt;,&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;I've moved out of the hosted feature class and into two other test environments and this is what I get.&lt;BR /&gt;&lt;BR /&gt;gdb:&amp;nbsp; Original code passes linter and rule is applied.&amp;nbsp; ArcGIS Pro works as expected passing value to child.&lt;/P&gt;&lt;LI-CODE lang="c"&gt;var parent_fs = FeatureSetByRelationshipName($feature, "t12_projects_rc")
var parent = First(parent_fs)
if(parent == null) { return }
return parent.project_pw&lt;/LI-CODE&gt;&lt;P&gt;&lt;BR /&gt;edgb: The linter rejects the code above (and OP code).&amp;nbsp; The linter only accepts this code (no First()), as you suggested.&amp;nbsp; However, once the rule is applied, the child table does not work.&amp;nbsp; No value is passed to child&amp;nbsp; in ArcGIS Pro, and errors occur published web apps.&lt;/P&gt;&lt;LI-CODE lang="c"&gt;var parent_fs = FeatureSetByRelationshipName($feature, "t12_projects_rc")
if(parent_fs == null) { return }
return parent_fs.project_pw&lt;/LI-CODE&gt;&lt;P&gt;&lt;BR /&gt;I tried both traditional and branch version db connections.&amp;nbsp; Any other ideas?&lt;BR /&gt;&lt;BR /&gt;Tyler&lt;BR /&gt;Enterprise 11.2&lt;BR /&gt;ArcGIS Pro 3.2.0&lt;/P&gt;</description>
      <pubDate>Tue, 19 Mar 2024 21:18:18 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/add-attribute-rule-help-with-arcade-expression/m-p/1398095#M80637</guid>
      <dc:creator>TylerT</dc:creator>
      <dc:date>2024-03-19T21:18:18Z</dc:date>
    </item>
    <item>
      <title>Re: Add Attribute Rule, Help With Arcade Expression (Pass value from Parent to Child, Calculation)</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/add-attribute-rule-help-with-arcade-expression/m-p/1398967#M80738</link>
      <description>&lt;P&gt;Hi All,&lt;BR /&gt;&lt;BR /&gt;Okay, A couple of days of pounding my head against the wall and I figured it out.&amp;nbsp; The FeatureSetByRelationshipName function in the Arcade Expression required the full EGDB table name (i.e. 'DBO...') as shown below, contrary to the in_table argument of the&amp;nbsp;arcpy.management.AddAttributeRule() method which does not.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="TylerT_0-1711025698710.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/98627i9D32869ED68A7D28/image-size/medium?v=v2&amp;amp;px=400" role="button" title="TylerT_0-1711025698710.png" alt="TylerT_0-1711025698710.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;HTH somebody else.&lt;BR /&gt;&lt;BR /&gt;Tyler&lt;/P&gt;</description>
      <pubDate>Thu, 21 Mar 2024 12:57:35 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/add-attribute-rule-help-with-arcade-expression/m-p/1398967#M80738</guid>
      <dc:creator>TylerT</dc:creator>
      <dc:date>2024-03-21T12:57:35Z</dc:date>
    </item>
  </channel>
</rss>

