<?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: Attribute Rule to grab geometry from parent and apply it to child in Attribute Rules Questions</title>
    <link>https://community.esri.com/t5/attribute-rules-questions/attribute-rule-to-grab-geometry-from-parent-and/m-p/1318278#M1046</link>
    <description>&lt;P&gt;Works like a charm!&amp;nbsp; Much appreciated!&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 14 Aug 2023 12:26:34 GMT</pubDate>
    <dc:creator>BillMoody</dc:creator>
    <dc:date>2023-08-14T12:26:34Z</dc:date>
    <item>
      <title>Attribute Rule to grab geometry from parent and apply it to child</title>
      <link>https://community.esri.com/t5/attribute-rules-questions/attribute-rule-to-grab-geometry-from-parent-and/m-p/1317940#M1043</link>
      <description>&lt;P&gt;I have been using attribute rules to fetch information from a related parent table and insert it into a target table, using the FeatureSetByRelationshipName function.&amp;nbsp; This is for an urban forestry work history system.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is an example:&lt;/P&gt;&lt;P&gt;&lt;EM&gt;var relationship = FeatureSetByRelationshipName($feature, 'RelationshipName', ['TreeSpecies'], false);&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;// check size of FeatureSet, return null if empty&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;if(Count(relationship) == 0) { return null }&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;return First(relationship).TreeSpecies&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;I'm wondering if it is possible to do this with geometry.&amp;nbsp; Meaning, I want to create a point for work history and add it to a relationship with a particular tree.&amp;nbsp; Then, upon update, it will fetch the geometry of the tree point and insert that into the geometry of the work point, making the work stack directly on top of the tree it's associated with.&lt;/P&gt;&lt;P&gt;Any help is appreciated&lt;/P&gt;</description>
      <pubDate>Fri, 11 Aug 2023 16:48:34 GMT</pubDate>
      <guid>https://community.esri.com/t5/attribute-rules-questions/attribute-rule-to-grab-geometry-from-parent-and/m-p/1317940#M1043</guid>
      <dc:creator>BillMoody</dc:creator>
      <dc:date>2023-08-11T16:48:34Z</dc:date>
    </item>
    <item>
      <title>Re: Attribute Rule to grab geometry from parent and apply it to child</title>
      <link>https://community.esri.com/t5/attribute-rules-questions/attribute-rule-to-grab-geometry-from-parent-and/m-p/1318023#M1044</link>
      <description>&lt;P&gt;To post code:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="JohannesLindner_0-1689266678674.png" style="width: 546px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/75345i1DB988B7B4303219/image-size/large?v=v2&amp;amp;px=999" role="button" title="JohannesLindner_0-1689266678674.png" alt="JohannesLindner_0-1689266678674.png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="JohannesLindner_1-1689266693900.png" style="width: 469px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/75346i06615A9413162052/image-size/large?v=v2&amp;amp;px=999" role="button" title="JohannesLindner_1-1689266693900.png" alt="JohannesLindner_1-1689266693900.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;P&gt;&lt;SPAN&gt;I'm wondering if it is possible to do this with geometry&lt;/SPAN&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;SPAN&gt;Yep. Set the Field to "Shape" and return the other feature's geometry:&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;// bla bla
return Geometry(First(relationship))&lt;/LI-CODE&gt;</description>
      <pubDate>Fri, 11 Aug 2023 20:03:17 GMT</pubDate>
      <guid>https://community.esri.com/t5/attribute-rules-questions/attribute-rule-to-grab-geometry-from-parent-and/m-p/1318023#M1044</guid>
      <dc:creator>JohannesLindner</dc:creator>
      <dc:date>2023-08-11T20:03:17Z</dc:date>
    </item>
    <item>
      <title>Re: Attribute Rule to grab geometry from parent and apply it to child</title>
      <link>https://community.esri.com/t5/attribute-rules-questions/attribute-rule-to-grab-geometry-from-parent-and/m-p/1318032#M1045</link>
      <description>&lt;P&gt;it is as&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/294341"&gt;@JohannesLindner&lt;/a&gt;&amp;nbsp;suggested,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;one thing I would add for performance reason, remove the count query, you are essentially executing two queries, replace it with this&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;var relationship = FeatureSetByRelationshipName($feature, 'RelationshipName', ['TreeSpecies'], false);

// check size of FeatureSet, return null if empty
//if(Count(relationship) == 0) { return null } 
var f = First(relationship);
if (f == null) return null; //if no features exist quit.. 
return f.TreeSpecies&lt;/LI-CODE&gt;</description>
      <pubDate>Fri, 11 Aug 2023 20:25:54 GMT</pubDate>
      <guid>https://community.esri.com/t5/attribute-rules-questions/attribute-rule-to-grab-geometry-from-parent-and/m-p/1318032#M1045</guid>
      <dc:creator>HusseinNasser2</dc:creator>
      <dc:date>2023-08-11T20:25:54Z</dc:date>
    </item>
    <item>
      <title>Re: Attribute Rule to grab geometry from parent and apply it to child</title>
      <link>https://community.esri.com/t5/attribute-rules-questions/attribute-rule-to-grab-geometry-from-parent-and/m-p/1318278#M1046</link>
      <description>&lt;P&gt;Works like a charm!&amp;nbsp; Much appreciated!&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 14 Aug 2023 12:26:34 GMT</pubDate>
      <guid>https://community.esri.com/t5/attribute-rules-questions/attribute-rule-to-grab-geometry-from-parent-and/m-p/1318278#M1046</guid>
      <dc:creator>BillMoody</dc:creator>
      <dc:date>2023-08-14T12:26:34Z</dc:date>
    </item>
    <item>
      <title>Re: Attribute Rule to grab geometry from parent and apply it to child</title>
      <link>https://community.esri.com/t5/attribute-rules-questions/attribute-rule-to-grab-geometry-from-parent-and/m-p/1318281#M1047</link>
      <description>&lt;P&gt;Thanks for the tip, as well as your many tutorials, they have been a tremendous help!&amp;nbsp; I applied this change to all of my rules now.&lt;/P&gt;</description>
      <pubDate>Mon, 14 Aug 2023 12:31:44 GMT</pubDate>
      <guid>https://community.esri.com/t5/attribute-rules-questions/attribute-rule-to-grab-geometry-from-parent-and/m-p/1318281#M1047</guid>
      <dc:creator>BillMoody</dc:creator>
      <dc:date>2023-08-14T12:31:44Z</dc:date>
    </item>
    <item>
      <title>Re: Attribute Rule to grab geometry from parent and apply it to child</title>
      <link>https://community.esri.com/t5/attribute-rules-questions/attribute-rule-to-grab-geometry-from-parent-and/m-p/1318679#M1048</link>
      <description>&lt;P&gt;This works great in ArcPro but when I republished the feature layer (Portal 10.9.1), I'm running into this error:&lt;BR /&gt;" Unable to submit: com.esri.arcgisruntime.ArcGISRuntimeException: Check getCause() for further error information"&lt;BR /&gt;&lt;BR /&gt;This error only occurs when I try to update an existing record (which makes sense because the rules are triggered by "Update").&amp;nbsp; I disabled the geometry rule for now and everything seems to function correctly.&lt;/P&gt;&lt;P&gt;Here is the rule:&lt;/P&gt;&lt;LI-CODE lang="c"&gt;var relationship = FeatureSetByRelationshipName($feature, 'SBCommons.ParksEnvironmental.Trees_TreeWorkOrders', ['Shape'], false);
var f = First(relationship);
if (f == null) return null; //if no features exist quit.. 
return Geometry(f)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any thoughts or ideas are appreciated!&lt;/P&gt;</description>
      <pubDate>Tue, 15 Aug 2023 14:11:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/attribute-rules-questions/attribute-rule-to-grab-geometry-from-parent-and/m-p/1318679#M1048</guid>
      <dc:creator>BillMoody</dc:creator>
      <dc:date>2023-08-15T14:11:42Z</dc:date>
    </item>
  </channel>
</rss>

