<?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 pass a value from parent to child in ArcGIS Pro Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-questions/attribute-rule-to-pass-a-value-from-parent-to/m-p/1533437#M87836</link>
    <description>&lt;P&gt;I've spent the last several hours with the same problem - I appreciate all the feedback, you've been generous with your time.&amp;nbsp; So now my rule works too!!&amp;nbsp; BUT only after I update the record???&amp;nbsp; Why doesn't on "Insert"&amp;nbsp; trigger the rule as the record is created... our workflow is for inspection records - you don't typically ever go back and "Update" them - so really the rule is not functioning as hoped.&amp;nbsp; I will be continuing to figure out what I'm missing to get the rule to work as the new record is created.&amp;nbsp; Thanks.&lt;/P&gt;</description>
    <pubDate>Fri, 30 Aug 2024 16:00:01 GMT</pubDate>
    <dc:creator>MHeadley</dc:creator>
    <dc:date>2024-08-30T16:00:01Z</dc:date>
    <item>
      <title>Attribute Rule to pass a value from parent to child</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/attribute-rule-to-pass-a-value-from-parent-to/m-p/1123857#M48818</link>
      <description>&lt;P&gt;Hello. I'm attempting to pass a value from a parent feature to a related table using an Attribute Rule. The idea being that when a new related record is created it automatically populates this field based on its corresponding parent value. This seems like it should be easy to do but the arcade expression is proving challenging for my beginner level of arcade experience. The fields are both called "GPMDesign" and are both "Long" field types.&amp;nbsp; I'm running ArcGIS Pro 2.7.1 and Enterprise 10.8.1. Thank you!&lt;/P&gt;</description>
      <pubDate>Wed, 08 Dec 2021 15:59:24 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/attribute-rule-to-pass-a-value-from-parent-to/m-p/1123857#M48818</guid>
      <dc:creator>dcamara924</dc:creator>
      <dc:date>2021-12-08T15:59:24Z</dc:date>
    </item>
    <item>
      <title>Re: Attribute Rule to pass a value from parent to child</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/attribute-rule-to-pass-a-value-from-parent-to/m-p/1123874#M48820</link>
      <description>&lt;P&gt;Take a look at the &lt;A href="https://doc.arcgis.com/en/arcgis-solutions/latest/reference/introduction-to-address-data-management.htm" target="_self"&gt;ESRI Address Data Management Solution&lt;/A&gt;; it has similar rules written between address points and related site address points. There is an aprx you can download that has sample data and the rules are applied there.&lt;/P&gt;</description>
      <pubDate>Wed, 08 Dec 2021 16:30:07 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/attribute-rule-to-pass-a-value-from-parent-to/m-p/1123874#M48820</guid>
      <dc:creator>JoeBorgione</dc:creator>
      <dc:date>2021-12-08T16:30:07Z</dc:date>
    </item>
    <item>
      <title>Re: Attribute Rule to pass a value from parent to child</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/attribute-rule-to-pass-a-value-from-parent-to/m-p/1123961#M48830</link>
      <description>&lt;P&gt;Thanks Joe. I think I found what you were referring to in one of the web map's pop up configurations. Neither the tables or feature layers had actual Attribute Rules on them that I could see. It still seems way more complicated than it should though. I'll keep tinkering with the FeatureSet functions.&lt;/P&gt;</description>
      <pubDate>Wed, 08 Dec 2021 18:58:27 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/attribute-rule-to-pass-a-value-from-parent-to/m-p/1123961#M48830</guid>
      <dc:creator>dcamara924</dc:creator>
      <dc:date>2021-12-08T18:58:27Z</dc:date>
    </item>
    <item>
      <title>Re: Attribute Rule to pass a value from parent to child</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/attribute-rule-to-pass-a-value-from-parent-to/m-p/1123966#M48831</link>
      <description>&lt;P&gt;The rules are fairly complicated, but I can find them by Right Clicking on Address Points in the table of contents, selecting Design and then Attribute Rules.&amp;nbsp; In the solution, the work flow has the user drop an Address Point on a street centerline and through a relationship class a Site Address Point is created.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="JoeBorgione_0-1638990286653.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/29151iEDD3E2F39BCB9D22/image-size/medium?v=v2&amp;amp;px=400" role="button" title="JoeBorgione_0-1638990286653.png" alt="JoeBorgione_0-1638990286653.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 08 Dec 2021 19:04:57 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/attribute-rule-to-pass-a-value-from-parent-to/m-p/1123966#M48831</guid>
      <dc:creator>JoeBorgione</dc:creator>
      <dc:date>2021-12-08T19:04:57Z</dc:date>
    </item>
    <item>
      <title>Re: Attribute Rule to pass a value from parent to child</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/attribute-rule-to-pass-a-value-from-parent-to/m-p/1124219#M48859</link>
      <description>&lt;LI-CODE lang="javascript"&gt;// calculation attribute rule on child
// field: if you want to get only one field from the parent, then chose 
// that field. if you want to get multiple fields, leave empty
// triggers: Insert(, update)

// load the related parent features using one of these methods
// if you have a relationship class between parent and child:
var parent_fs = FeatureSetByRelationshipName($feature, "RelationshipName")
// if not
var parent_fs = FeatureSetByName($datastore, "NameOfParentFC")
var key = $feature.ForeignKeyField
parent_fs = Filter(parent_fs, "PrimaryKeyField = @key")

// return nothing if no parent feature was found
var parent = First(parent_fs)
if(parent == null) { return }

// if you want to return only one field:
return parent.Field

// if you want to return multiple fields:
var att = {
  "Field1": parent.Field1,
  "Field2": parent.Field2
}
return {"result": {"attributes": att}}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 09 Dec 2021 09:09:40 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/attribute-rule-to-pass-a-value-from-parent-to/m-p/1124219#M48859</guid>
      <dc:creator>JohannesLindner</dc:creator>
      <dc:date>2021-12-09T09:09:40Z</dc:date>
    </item>
    <item>
      <title>Re: Attribute Rule to pass a value from parent to child</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/attribute-rule-to-pass-a-value-from-parent-to/m-p/1124859#M48909</link>
      <description>&lt;P&gt;Thanks Johannes! This helped me develop what I was looking for. Simple and straightforward. Much appreciated.&lt;/P&gt;</description>
      <pubDate>Fri, 10 Dec 2021 14:55:24 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/attribute-rule-to-pass-a-value-from-parent-to/m-p/1124859#M48909</guid>
      <dc:creator>dcamara924</dc:creator>
      <dc:date>2021-12-10T14:55:24Z</dc:date>
    </item>
    <item>
      <title>Re: Attribute Rule to pass a value from parent to child</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/attribute-rule-to-pass-a-value-from-parent-to/m-p/1132743#M49856</link>
      <description>&lt;P&gt;Hi!&lt;/P&gt;&lt;P&gt;I'm trying this and can't make it work somehow.&lt;/P&gt;&lt;P&gt;My feature class, relationship class and table are stored in an sde database. I have a relationship class between parent and child. My script looks like this. It validates but when I create a new feature the field in which the attriute rule is applied won't update.&lt;/P&gt;&lt;P&gt;// calculation attribute rule on child&lt;BR /&gt;// field: if you want to get only one field from the parent, then chose&lt;BR /&gt;// that field. if you want to get multiple fields, leave empty&lt;BR /&gt;// triggers: Insert(, update)&lt;/P&gt;&lt;P&gt;// load the related parent features using one of these methods&lt;BR /&gt;// if you have a relationship class between parent and child:&lt;BR /&gt;var parent_fs = FeatureSetByRelationshipName($feature, "Matstallen_Rate", ['Namn'])&lt;/P&gt;&lt;P&gt;// return nothing if no parent feature was found&lt;BR /&gt;var parent = First(parent_fs)&lt;BR /&gt;if (parent == null) { return }&lt;/P&gt;&lt;P&gt;// if you want to return only one field:&lt;BR /&gt;return parent&lt;/P&gt;&lt;P&gt;Super thankful for your help&lt;/P&gt;</description>
      <pubDate>Wed, 12 Jan 2022 07:02:53 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/attribute-rule-to-pass-a-value-from-parent-to/m-p/1132743#M49856</guid>
      <dc:creator>PetronellaHauptmann1</dc:creator>
      <dc:date>2022-01-12T07:02:53Z</dc:date>
    </item>
    <item>
      <title>Re: Attribute Rule to pass a value from parent to child</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/attribute-rule-to-pass-a-value-from-parent-to/m-p/1132766#M49864</link>
      <description>&lt;P&gt;Your problem is in the last line: You try to return the whole parent feature. Even if you only load one field (Namn), the feature still holds other information, such as geometry. You have to specify what field you want to return:&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;return parent.Namn&lt;/LI-CODE&gt;</description>
      <pubDate>Wed, 12 Jan 2022 09:03:36 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/attribute-rule-to-pass-a-value-from-parent-to/m-p/1132766#M49864</guid>
      <dc:creator>JohannesLindner</dc:creator>
      <dc:date>2022-01-12T09:03:36Z</dc:date>
    </item>
    <item>
      <title>Re: Attribute Rule to pass a value from parent to child</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/attribute-rule-to-pass-a-value-from-parent-to/m-p/1132770#M49866</link>
      <description>&lt;P&gt;Thanks Johannes, but sadly it doesn't work.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="PetronellaHauptmann1_0-1641979217968.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/31262iFDF4DE2B08FBAEB4/image-size/medium?v=v2&amp;amp;px=400" role="button" title="PetronellaHauptmann1_0-1641979217968.png" alt="PetronellaHauptmann1_0-1641979217968.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;This error occurs. Any suggestions to what might be the issue?&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm new to Arcade, and I've been trying to find the solution for days now, but I'm stuck.&lt;/P&gt;</description>
      <pubDate>Wed, 12 Jan 2022 09:21:35 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/attribute-rule-to-pass-a-value-from-parent-to/m-p/1132770#M49866</guid>
      <dc:creator>PetronellaHauptmann1</dc:creator>
      <dc:date>2022-01-12T09:21:35Z</dc:date>
    </item>
    <item>
      <title>Re: Attribute Rule to pass a value from parent to child</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/attribute-rule-to-pass-a-value-from-parent-to/m-p/1132771#M49867</link>
      <description>&lt;UL&gt;&lt;LI&gt;Try using the simple name of the field (like you did in your code above):&lt;/LI&gt;&lt;/UL&gt;&lt;LI-CODE lang="javascript"&gt;var parent_fs = FeatureSetByRelationshipName($feature, "Matstallen_Rate", ['Namn'])&lt;/LI-CODE&gt;&lt;UL&gt;&lt;LI&gt;Make sure that "Matstallen_Rate" is actually the name of the relationship class, not the name of the parent feature class!&lt;/LI&gt;&lt;LI&gt;Try using the full name of the relationship class: "DatabaseName.DataOwner.Matstallen_Rate"&lt;/LI&gt;&lt;/UL&gt;</description>
      <pubDate>Wed, 12 Jan 2022 09:32:45 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/attribute-rule-to-pass-a-value-from-parent-to/m-p/1132771#M49867</guid>
      <dc:creator>JohannesLindner</dc:creator>
      <dc:date>2022-01-12T09:32:45Z</dc:date>
    </item>
    <item>
      <title>Re: Attribute Rule to pass a value from parent to child</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/attribute-rule-to-pass-a-value-from-parent-to/m-p/1132793#M49870</link>
      <description>&lt;P&gt;Still empty &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="PetronellaHauptmann1_0-1641983682581.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/31273iEA4511B192E545FC/image-size/medium?v=v2&amp;amp;px=400" role="button" title="PetronellaHauptmann1_0-1641983682581.png" alt="PetronellaHauptmann1_0-1641983682581.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;I am super greatful for all your valuable help. In my head this seemed like a really basic task, but I can't make it work.&lt;/P&gt;</description>
      <pubDate>Wed, 12 Jan 2022 10:36:26 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/attribute-rule-to-pass-a-value-from-parent-to/m-p/1132793#M49870</guid>
      <dc:creator>PetronellaHauptmann1</dc:creator>
      <dc:date>2022-01-12T10:36:26Z</dc:date>
    </item>
    <item>
      <title>Re: Attribute Rule to pass a value from parent to child</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/attribute-rule-to-pass-a-value-from-parent-to/m-p/1132811#M49872</link>
      <description>&lt;P&gt;Have you actually triggered the rule? Eg updated the feature? Try putting in a value into Kommentar or Namn&lt;/P&gt;</description>
      <pubDate>Wed, 12 Jan 2022 11:17:22 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/attribute-rule-to-pass-a-value-from-parent-to/m-p/1132811#M49872</guid>
      <dc:creator>JohannesLindner</dc:creator>
      <dc:date>2022-01-12T11:17:22Z</dc:date>
    </item>
    <item>
      <title>Re: Attribute Rule to pass a value from parent to child</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/attribute-rule-to-pass-a-value-from-parent-to/m-p/1132823#M49878</link>
      <description>&lt;P&gt;Now I feel ashamed. I've only tried to add new rates, not updating existing ones. The rule works.&lt;/P&gt;&lt;P&gt;Thank you so much for your patience and your help!&lt;/P&gt;&lt;P&gt;All the best!&lt;/P&gt;</description>
      <pubDate>Wed, 12 Jan 2022 12:03:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/attribute-rule-to-pass-a-value-from-parent-to/m-p/1132823#M49878</guid>
      <dc:creator>PetronellaHauptmann1</dc:creator>
      <dc:date>2022-01-12T12:03:42Z</dc:date>
    </item>
    <item>
      <title>Re: Attribute Rule to pass a value from parent to child</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/attribute-rule-to-pass-a-value-from-parent-to/m-p/1132826#M49880</link>
      <description>&lt;P&gt;No reason to be ashamed, we've all had our share of facepalm moments... Glad it works &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;If you want to trigger the rule for all features, use CalculateField on Namn and just put some random value in it.&lt;/P&gt;</description>
      <pubDate>Wed, 12 Jan 2022 12:13:27 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/attribute-rule-to-pass-a-value-from-parent-to/m-p/1132826#M49880</guid>
      <dc:creator>JohannesLindner</dc:creator>
      <dc:date>2022-01-12T12:13:27Z</dc:date>
    </item>
    <item>
      <title>Re: Attribute Rule to pass a value from parent to child</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/attribute-rule-to-pass-a-value-from-parent-to/m-p/1219556#M60784</link>
      <description>&lt;P&gt;Fingers crossed that someone may still be following this thread.&lt;/P&gt;&lt;P&gt;I am trying to alter this code to 1) go from children to parent and 2) with a sum on the child field instead of the first record being transferred.&amp;nbsp; I have so far only managed to successfully complete 1.&amp;nbsp; I have tried various ways of using Sum() in different locations and finally came to a way where it didn't give me an error but it still only give me the first record not the sum.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am totally new to python so I am just using trial and error here and apologize if the answer is looking right back at me but any help would be appreciated.&lt;/P&gt;&lt;LI-CODE lang="c"&gt;/// calculation attribute rule on parent
// field: if you want to get only one field from the child, then chose 
// that field. if you want to get multiple fields, leave empty
// triggers: Insert(, update)

// load the related child features using one of these methods
// if you have a relationship class between parent and child:
var child_fs = FeatureSetByRelationshipName($feature, "ApplicationSite_TurfArea", ['Area'])

// return nothing if no child feature was found
var child =  sum($feature,child_fs)
if(child == null) { return }

// if you want to return only one field:
return child


return {"result": {"attributes": att}}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Additionally this is going to get more complicated as I want to eventually create a sum from the Area based on the input for another field.&amp;nbsp; i.e. some all child areas that have "post inspection" in the Status field. But I found that if I work out one piece of a code at a time I can try to piece them together.&lt;/P&gt;</description>
      <pubDate>Thu, 06 Oct 2022 19:21:45 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/attribute-rule-to-pass-a-value-from-parent-to/m-p/1219556#M60784</guid>
      <dc:creator>HMarcks</dc:creator>
      <dc:date>2022-10-06T19:21:45Z</dc:date>
    </item>
    <item>
      <title>Re: Attribute Rule to pass a value from parent to child</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/attribute-rule-to-pass-a-value-from-parent-to/m-p/1219783#M60812</link>
      <description>&lt;P&gt;&lt;A href="https://developers.arcgis.com/arcade/function-reference/math_functions/#sum" target="_blank" rel="noopener"&gt;Sum()&lt;/A&gt; takes a Featureset and a field als arguments.&lt;/P&gt;&lt;P&gt;I included a &lt;A href="https://developers.arcgis.com/arcade/function-reference/data_functions/#filter" target="_blank" rel="noopener"&gt;Filter()&lt;/A&gt; to search for the value in the status field.&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;var child_fs = FeatureSetByRelationshipName($feature, "ApplicationSite_TurfArea", ['Area', 'Status'])
var filterd_child_fs = Filter(child_fs, "Status = 'post inspection'")
return Sum(filterd_child_fs, "Area")&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 07 Oct 2022 12:36:24 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/attribute-rule-to-pass-a-value-from-parent-to/m-p/1219783#M60812</guid>
      <dc:creator>JohannesLindner</dc:creator>
      <dc:date>2022-10-07T12:36:24Z</dc:date>
    </item>
    <item>
      <title>Re: Attribute Rule to pass a value from parent to child</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/attribute-rule-to-pass-a-value-from-parent-to/m-p/1219974#M60840</link>
      <description>&lt;P&gt;Amazing! Thank you.&lt;/P&gt;&lt;P&gt;I was starting to come to this conclusion yesterday but I could not quite figure out how to "word" the filter and just kept getting errors.&amp;nbsp; Works great now and I have duplicated it to provide the totals for all of our different statuses into the parent field.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="c"&gt;var child_fs = FeatureSetByRelationshipName($feature, "ApplicationSite_TurfArea", ['Area', 'Status'])

var filterd_child_fs = Filter(child_fs, "Status = 2")
if(filterd_child_fs == null) { return }

return Sum(filterd_child_fs, "Area")&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;With the help of this blog&amp;nbsp;&lt;A href="https://github.com/Esri/arcade-expressions/blob/master/attribute_rule_calculation/UpdateParentFeature.md" target="_blank" rel="noopener"&gt;https://github.com/Esri/arcade-expressions/blob/master/attribute_rule_calculation/UpdateParentFeature.md&lt;/A&gt;&amp;nbsp;I was also able to add an event to the child fields to trigger the recalculation if only they were edited and not the parent field.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="c"&gt;// This rule will update an attribute in the parent feature

// Store the parent feature global from the key field in the relationship
var parent_id = $feature.GUIDApplicationSite;
if (IsEmpty(parent_id))
    return parent_id;

// force to upper as the sql is case sensitive
parent_id = Upper(parent_id);

// Using the GDB name, get the parent classes records and Global ID field
var parent_class = FeatureSetByName($datastore, "ApplicationSite", ["globalid", 'laststatus'], false);
// Filter the parent class for only related features
var parent_records = Filter(parent_class, "globalid = @parent_id");

var updates = [];
var i = 0;
var new_value = 0;

if (IsEmpty($feature.Status) == False)
{
    new_value = $feature.Status
}

// Loop through each  feature, create a dict of the Global ID and the new value date
for (var row in parent_records) {
    // If the parent row is null or has a different value, updated it
    if (IsEmpty(row['laststatus']) || row['laststatus'] != new_value)
    {
        updates[i++] = {
            'globalid': parent_id,
            'attributes': {"laststatus": new_value}    
        };
    }
}

// Return the original value in the result parameter, as to not lost the entered value
// Using the edit parameter,  return the class and list of updates
return {
'result': parent_id,
'edit': [
            {'className': 'ApplicationSite',
             'updates': updates
            } 
        ]
};&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;I probably could have simplified it better since I am not looking through multiple fields to get the status but it all seems to work very nicely now.&lt;/P&gt;&lt;P&gt;I am a little curious what will happen to all this when I transfer it to AGOL so it can be used in field maps LOL but I guess I will find out soon enough.&lt;/P&gt;&lt;P&gt;Thank you, again.&lt;/P&gt;</description>
      <pubDate>Fri, 07 Oct 2022 17:39:43 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/attribute-rule-to-pass-a-value-from-parent-to/m-p/1219974#M60840</guid>
      <dc:creator>HMarcks</dc:creator>
      <dc:date>2022-10-07T17:39:43Z</dc:date>
    </item>
    <item>
      <title>Re: Attribute Rule to pass a value from parent to child</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/attribute-rule-to-pass-a-value-from-parent-to/m-p/1272535#M67283</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/294341"&gt;@JohannesLindner&lt;/a&gt;&amp;nbsp;.&amp;nbsp; So I'm using the code below which kind of works for updating multiple fields in the child object based on the matching field in the parent, but it only works when I update the child, not when the child is first created.&amp;nbsp; (I do have both the update and insert triggers checked).&lt;/P&gt;&lt;P&gt;Is there something I am missing in order to get it to work when the records is first created??&lt;/P&gt;&lt;LI-CODE lang="c"&gt;var parent_fs = FeatureSetByRelationshipName($feature, "SAN_Manhole_To_SAN_Manhole_Inspection");
var key = $feature.FACILITYID;
parent_fs = Filter(parent_fs, "FACILITYID = @key");

var manhole = First(parent_fs);
if (manhole == null) {return};

// get the manhole feature
//var manholes = FeaturesetByName($datastore, 'SAN_Manhole', ['LOCATIONDESCRIPTION', 'SETTLEMENTAREA', 'LOCALMUNICIPALITY', 'DEPOTAREA'], false);
//var facility_id = $feature.FACILITYID;

//var manhole = First(Filter(manholes, 'FACILITYID = @facility_id'));
//if (manhole == null) {return};

var atts = 
{
    "LOCATIONDESCRIPTION": manhole.LOCATIONDESCRIPTION,
    "SETTLEMENTAREA": manhole.SETTLEMENTAREA,
    "LOCALMUNICIPALITY": manhole.LOCALMUNICIPALITY,
    "DEPOTAREA": manhole.DEPOTAREA
};

return {"result": {"attributes": atts}};


&lt;/LI-CODE&gt;</description>
      <pubDate>Tue, 28 Mar 2023 15:36:01 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/attribute-rule-to-pass-a-value-from-parent-to/m-p/1272535#M67283</guid>
      <dc:creator>BrianBulla</dc:creator>
      <dc:date>2023-03-28T15:36:01Z</dc:date>
    </item>
    <item>
      <title>Re: Attribute Rule to pass a value from parent to child</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/attribute-rule-to-pass-a-value-from-parent-to/m-p/1272644#M67299</link>
      <description>&lt;P&gt;It looks as if the rule doesn't find the parent feature and aborts in line 6. You could test that theory by returning a default value if that happens.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Also, you're getting the related features in line 1 and then filter these features in lines 2&amp;amp;3. I used FeaturesetByName in my example and had to use the filter to get the related features. You use FeaturesetByRelationshipName, so the parent_fs already contains only the related features, the filter doesn't do anything.&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;var parent_fs = FeatureSetByRelationshipName($feature, "SAN_Manhole_To_SAN_Manhole_Inspection");

var manhole = First(parent_fs);
if (manhole == null) {return {"result": {"attributes": {"LOCATIONDESCRIPTION": "No parent feature found!"}}}};

var atts = 
{
    "LOCATIONDESCRIPTION": manhole.LOCATIONDESCRIPTION,
    "SETTLEMENTAREA": manhole.SETTLEMENTAREA,
    "LOCALMUNICIPALITY": manhole.LOCALMUNICIPALITY,
    "DEPOTAREA": manhole.DEPOTAREA
};

return {"result": {"attributes": atts}};&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 28 Mar 2023 18:20:57 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/attribute-rule-to-pass-a-value-from-parent-to/m-p/1272644#M67299</guid>
      <dc:creator>JohannesLindner</dc:creator>
      <dc:date>2023-03-28T18:20:57Z</dc:date>
    </item>
    <item>
      <title>Re: Attribute Rule to pass a value from parent to child</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/attribute-rule-to-pass-a-value-from-parent-to/m-p/1272651#M67301</link>
      <description>&lt;P&gt;Thanks....yes, I tried both with FeaturesetByName and FeaturesetByRelationshipName, but get the same results either way.&lt;/P&gt;&lt;P&gt;I'll add some console messages and try to figure this out.&lt;/P&gt;&lt;P&gt;Thanks for your help!&lt;/P&gt;</description>
      <pubDate>Tue, 28 Mar 2023 18:30:26 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/attribute-rule-to-pass-a-value-from-parent-to/m-p/1272651#M67301</guid>
      <dc:creator>BrianBulla</dc:creator>
      <dc:date>2023-03-28T18:30:26Z</dc:date>
    </item>
  </channel>
</rss>

