<?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 Can an Attribute Rule Passively Perform an Update? in Attribute Rules Questions</title>
    <link>https://community.esri.com/t5/attribute-rules-questions/can-an-attribute-rule-passively-perform-an-update/m-p/1477771#M1467</link>
    <description>&lt;P&gt;I have a feature class related to Table 1 (for illustration purposes) then Table 1 is related to Table 2.&amp;nbsp; The relationship classes are both based on GlobalID to GUID...all datasets are in an SDE environment.&amp;nbsp; Each of the 3 datasets contains the identical field 'Assembly_ID'.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;I want the 'Assembly_ID' value to be updated in Table 2 when the feature class field is updated.&lt;/STRONG&gt;&amp;nbsp; Currently, I have a functional attribute rule that will update the 'Assembly_ID' field in Table 1 when said field in the feature class is updated.&amp;nbsp; I have another functional rule that will update the 'Assembly_ID' field in Table 2 from said field in Table 1 when&amp;nbsp;&lt;EM&gt;some other field&lt;/EM&gt;&amp;nbsp;is updated in Table 1.&amp;nbsp; I don't want to have to perform an edit/update in Table 1 for the value to pass thru to Table 2.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is there a way to pass the value directly from the feature class to Table 2 (I DO NOT want to create a relationship between the feature class and Table 2...that field is the only common field between the feature class and Table 2) OR have the value pass from Table 1 to Table 2, passively, without some trigger being activated in Table 1?&lt;/P&gt;</description>
    <pubDate>Thu, 23 May 2024 16:16:38 GMT</pubDate>
    <dc:creator>ChristopherBowering</dc:creator>
    <dc:date>2024-05-23T16:16:38Z</dc:date>
    <item>
      <title>Can an Attribute Rule Passively Perform an Update?</title>
      <link>https://community.esri.com/t5/attribute-rules-questions/can-an-attribute-rule-passively-perform-an-update/m-p/1477771#M1467</link>
      <description>&lt;P&gt;I have a feature class related to Table 1 (for illustration purposes) then Table 1 is related to Table 2.&amp;nbsp; The relationship classes are both based on GlobalID to GUID...all datasets are in an SDE environment.&amp;nbsp; Each of the 3 datasets contains the identical field 'Assembly_ID'.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;I want the 'Assembly_ID' value to be updated in Table 2 when the feature class field is updated.&lt;/STRONG&gt;&amp;nbsp; Currently, I have a functional attribute rule that will update the 'Assembly_ID' field in Table 1 when said field in the feature class is updated.&amp;nbsp; I have another functional rule that will update the 'Assembly_ID' field in Table 2 from said field in Table 1 when&amp;nbsp;&lt;EM&gt;some other field&lt;/EM&gt;&amp;nbsp;is updated in Table 1.&amp;nbsp; I don't want to have to perform an edit/update in Table 1 for the value to pass thru to Table 2.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is there a way to pass the value directly from the feature class to Table 2 (I DO NOT want to create a relationship between the feature class and Table 2...that field is the only common field between the feature class and Table 2) OR have the value pass from Table 1 to Table 2, passively, without some trigger being activated in Table 1?&lt;/P&gt;</description>
      <pubDate>Thu, 23 May 2024 16:16:38 GMT</pubDate>
      <guid>https://community.esri.com/t5/attribute-rules-questions/can-an-attribute-rule-passively-perform-an-update/m-p/1477771#M1467</guid>
      <dc:creator>ChristopherBowering</dc:creator>
      <dc:date>2024-05-23T16:16:38Z</dc:date>
    </item>
    <item>
      <title>Re: Can an Attribute Rule Passively Perform an Update?</title>
      <link>https://community.esri.com/t5/attribute-rules-questions/can-an-attribute-rule-passively-perform-an-update/m-p/1477776#M1468</link>
      <description>&lt;P&gt;sure, you need to use FeatureSetByAssocation($feature) to get the table 1 feature, then use that feature again in FeatureSetByAssocation(ResultFeatureFromFirst) to get the second.&amp;nbsp; Then issue the DML to update that feature.&lt;/P&gt;&lt;P&gt;You can also just use featureSetByName and just build the pkey/fkey sql if you want too.&amp;nbsp; Same process&lt;/P&gt;</description>
      <pubDate>Thu, 23 May 2024 16:22:44 GMT</pubDate>
      <guid>https://community.esri.com/t5/attribute-rules-questions/can-an-attribute-rule-passively-perform-an-update/m-p/1477776#M1468</guid>
      <dc:creator>MikeMillerGIS</dc:creator>
      <dc:date>2024-05-23T16:22:44Z</dc:date>
    </item>
    <item>
      <title>Re: Can an Attribute Rule Passively Perform an Update?</title>
      <link>https://community.esri.com/t5/attribute-rules-questions/can-an-attribute-rule-passively-perform-an-update/m-p/1477820#M1469</link>
      <description>&lt;P&gt;Hi Mike - bear with me as I'm just reading about this function for the first time.&amp;nbsp; I also don't know what DML is or how to use it.&lt;/P&gt;&lt;P&gt;From the ESRI documentation I'm reviewing, I need to select an Association Type; would this be 'Content' in this case since I'm just dealing with a single value?&amp;nbsp; The examples I'm seeing almost exclusively return a count value as the result, as well.&amp;nbsp; I found &lt;A href="https://www.esri.com/arcgis-blog/products/utility-network/data-management/featuresetbyassocaitions-new-utility-network-arcade-api-to-work-with-associations-2-5-10-8/" target="_self"&gt;this blog post&lt;/A&gt; but the example is wayyy more complicated than what I'm trying to do.&lt;/P&gt;&lt;P&gt;Would the attribute rule be set on the feature class since it's pushing the value all the way down to Table 2?&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 23 May 2024 16:59:36 GMT</pubDate>
      <guid>https://community.esri.com/t5/attribute-rules-questions/can-an-attribute-rule-passively-perform-an-update/m-p/1477820#M1469</guid>
      <dc:creator>ChristopherBowering</dc:creator>
      <dc:date>2024-05-23T16:59:36Z</dc:date>
    </item>
    <item>
      <title>Re: Can an Attribute Rule Passively Perform an Update?</title>
      <link>https://community.esri.com/t5/attribute-rules-questions/can-an-attribute-rule-passively-perform-an-update/m-p/1477880#M1470</link>
      <description>&lt;P&gt;Sorry, not FeatureSetByAssociation(was working on a rule using that).&amp;nbsp; FeatureSetByRelationClass&lt;/P&gt;&lt;P&gt;Needs a lot more work, but something like this.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;var table1FS = FeatureSetByRelationshipClass($feature, “pole_inspection”,  [“comments”], false);
var table2FS = FeatureSetByRelationshipClass(First(table1FS), “pole_history”,  ["globalid",“comments”], false);

return {
    'edit': [{
        'className': 'pole_history',
        'updates': [{
            'globalID': first(table2FS.globalid),
            'attributes': {
                'comments':  first(table2FS.comments)
            }
        }]
    }]
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 23 May 2024 18:28:34 GMT</pubDate>
      <guid>https://community.esri.com/t5/attribute-rules-questions/can-an-attribute-rule-passively-perform-an-update/m-p/1477880#M1470</guid>
      <dc:creator>MikeMillerGIS</dc:creator>
      <dc:date>2024-05-23T18:28:34Z</dc:date>
    </item>
    <item>
      <title>Re: Can an Attribute Rule Passively Perform an Update?</title>
      <link>https://community.esri.com/t5/attribute-rules-questions/can-an-attribute-rule-passively-perform-an-update/m-p/1477962#M1471</link>
      <description>&lt;P&gt;No worries!&amp;nbsp; Your last response did the trick.&amp;nbsp; I combined how you created the variables with part of the attribute rule I was using within a single relationship class.&amp;nbsp; The following works as a two-step "jump" I guess I'll call it.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="c"&gt;if ($originalfeature.Assembly_ID == $feature.Assembly_ID) {
    return
}

var table1FS = FeatureSetByRelationshipClass($feature, "OCGIS.DPW_TESTING_REL",  ["Assembly_ID"], false);
var table2FS = FeatureSetByRelationshipClass(First(table1FS), "OCGIS.DPW_TESTING_Secondary_Table_REL",  ["globalid","Assembly_ID"], false);

fields to update
var updates = []
for(var f in table2FS) {
    if(f.GlobalID == $feature.GlobalID) { continue }
    if(f.Assembly_ID == $feature.Assembly_ID) continue;
    var u  = {
        globalID: f.GlobalID,
        attributes: {
            "Assembly_ID": $feature.Assembly_ID
            }
        }
    Push(updates, u)
}

return {
    edit: [{
        className: "OCGIS.DPW_TESTING_Secondary_Tabe",
        updates: updates
        }]
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for your help!&lt;/P&gt;</description>
      <pubDate>Thu, 23 May 2024 19:50:59 GMT</pubDate>
      <guid>https://community.esri.com/t5/attribute-rules-questions/can-an-attribute-rule-passively-perform-an-update/m-p/1477962#M1471</guid>
      <dc:creator>ChristopherBowering</dc:creator>
      <dc:date>2024-05-23T19:50:59Z</dc:date>
    </item>
    <item>
      <title>Re: Can an Attribute Rule Passively Perform an Update?</title>
      <link>https://community.esri.com/t5/attribute-rules-questions/can-an-attribute-rule-passively-perform-an-update/m-p/1478590#M1474</link>
      <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/188597"&gt;@MikeMillerGIS&lt;/a&gt;&amp;nbsp;I spoke a little bit too soon.&amp;nbsp; The script I included in my previous message does function how it should, however, only if an existing record is present in Table 2.&amp;nbsp; If there isn't one, I'm not even able to enter an Assembly ID value in the feature class to begin with.&amp;nbsp; I receive a "feature expected" error.&amp;nbsp; This is with the rule trigger being set to only "update" (I tried it with all triggers checked on as well).&amp;nbsp; Is there a way to make the rule only run if a corresponding record exists in Table 2?&amp;nbsp; Or, is there another way to account for this?&lt;/P&gt;</description>
      <pubDate>Fri, 24 May 2024 18:37:44 GMT</pubDate>
      <guid>https://community.esri.com/t5/attribute-rules-questions/can-an-attribute-rule-passively-perform-an-update/m-p/1478590#M1474</guid>
      <dc:creator>ChristopherBowering</dc:creator>
      <dc:date>2024-05-24T18:37:44Z</dc:date>
    </item>
    <item>
      <title>Re: Can an Attribute Rule Passively Perform an Update?</title>
      <link>https://community.esri.com/t5/attribute-rules-questions/can-an-attribute-rule-passively-perform-an-update/m-p/1478629#M1475</link>
      <description>&lt;P&gt;you just need to add some checks for first(fs) returning null&lt;/P&gt;</description>
      <pubDate>Fri, 24 May 2024 19:24:21 GMT</pubDate>
      <guid>https://community.esri.com/t5/attribute-rules-questions/can-an-attribute-rule-passively-perform-an-update/m-p/1478629#M1475</guid>
      <dc:creator>MikeMillerGIS</dc:creator>
      <dc:date>2024-05-24T19:24:21Z</dc:date>
    </item>
    <item>
      <title>Re: Can an Attribute Rule Passively Perform an Update?</title>
      <link>https://community.esri.com/t5/attribute-rules-questions/can-an-attribute-rule-passively-perform-an-update/m-p/1479503#M1476</link>
      <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/188597"&gt;@MikeMillerGIS&lt;/a&gt;&amp;nbsp;I have tried a handful of&amp;nbsp; checks using examples I've come across but none have worked so far.&amp;nbsp; I might have to create 2 of them because neither a record for Table 1 nor Table 2 will exist when a new feature is created and this script is using Table 1 to get to Table 2.&amp;nbsp; Is there a specific example you could point me to that may work in this scenario?&amp;nbsp; Or something creative you can think of?&lt;/P&gt;&lt;P&gt;Also, something that I've never seen before, this particular script/rule (even the functional version that solely updates the Table 2 record) can't be published in my current Enterprise version (11.0).&amp;nbsp; I get an error (00396) saying "The dataset version is later than is supported by your server. Minimum version 11.2".&amp;nbsp; As soon as I delete the attribute rule, the message goes away and all datasets containing all other rules publish without issue.&amp;nbsp; Some of the other rules use very similar scripts...so I'm not sure what it is about this particular script that can't be supported in publishing until Enterprise 11.2.&lt;/P&gt;</description>
      <pubDate>Tue, 28 May 2024 13:29:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/attribute-rules-questions/can-an-attribute-rule-passively-perform-an-update/m-p/1479503#M1476</guid>
      <dc:creator>ChristopherBowering</dc:creator>
      <dc:date>2024-05-28T13:29:42Z</dc:date>
    </item>
    <item>
      <title>Re: Can an Attribute Rule Passively Perform an Update?</title>
      <link>https://community.esri.com/t5/attribute-rules-questions/can-an-attribute-rule-passively-perform-an-update/m-p/1479549#M1477</link>
      <description>&lt;P&gt;You can check the min version and details on the rule in the Attribute Rule design view.&amp;nbsp; You can also look at the functions online&lt;/P&gt;&lt;P&gt;FeatureSetByRelationshipClass was new at 1.24&lt;/P&gt;&lt;P&gt;&lt;A href="https://developers.arcgis.com/arcade/function-reference/featureset_functions/#featuresetbyrelationshipclass" target="_blank"&gt;https://developers.arcgis.com/arcade/function-reference/featureset_functions/#featuresetbyrelationshipclass&lt;/A&gt;&lt;/P&gt;&lt;P&gt;If you need to support older versions, you would need to move to&amp;nbsp;&lt;A href="https://developers.arcgis.com/arcade/function-reference/featureset_functions/#featuresetbyrelationshipname" target="_blank"&gt;https://developers.arcgis.com/arcade/function-reference/featureset_functions/#featuresetbyrelationshipname&lt;/A&gt;&lt;/P&gt;&lt;P&gt;or manually build the sql and use FeatureSetByName&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is your code with some checks to handle empty stuff&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;if ($originalfeature.Assembly_ID == $feature.Assembly_ID) {
    return
}

var table1FS = FeatureSetByRelationshipClass($feature, "OCGIS.DPW_TESTING_REL",  ["Assembly_ID"], false);
var first_hop = First(table1FS)
if (IsEmpty(first_hop))
    {
        return
    }
var table2FS = FeatureSetByRelationshipClass(first_hop, "OCGIS.DPW_TESTING_Secondary_Table_REL",  ["globalid","Assembly_ID"], false);

var updates = []
for(var f in table2FS) {
    if(f.GlobalID == $feature.GlobalID) { continue }
    if(f.Assembly_ID == $feature.Assembly_ID) continue;
    var u  = {
        globalID: f.GlobalID,
        attributes: {
            "Assembly_ID": $feature.Assembly_ID
            }
        }
    Push(updates, u)
}
if (Count(updates) == 0 ){
    return
}
return {
    edit: [{
        className: "OCGIS.DPW_TESTING_Secondary_Tabe",
        updates: updates
        }]
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 28 May 2024 14:31:11 GMT</pubDate>
      <guid>https://community.esri.com/t5/attribute-rules-questions/can-an-attribute-rule-passively-perform-an-update/m-p/1479549#M1477</guid>
      <dc:creator>MikeMillerGIS</dc:creator>
      <dc:date>2024-05-28T14:31:11Z</dc:date>
    </item>
    <item>
      <title>Re: Can an Attribute Rule Passively Perform an Update?</title>
      <link>https://community.esri.com/t5/attribute-rules-questions/can-an-attribute-rule-passively-perform-an-update/m-p/1479568#M1478</link>
      <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/188597"&gt;@MikeMillerGIS&lt;/a&gt;&amp;nbsp;Thanks for the script adjustments, I'll give it a go!&lt;/P&gt;&lt;P&gt;I didn't know about that matrix; that's really interesting.&amp;nbsp; I guess I never paid much attention to the minimum release information in the design view.&amp;nbsp; I believe we're upgrading to 11.2 later this year.&amp;nbsp; Odd that the minimum release for that rule is showing 11.3 in Pro despite the error prompt saying minimum release was 11.2.&amp;nbsp; The matrix shows 'N/A' for v 1.24.&lt;/P&gt;</description>
      <pubDate>Tue, 28 May 2024 15:00:27 GMT</pubDate>
      <guid>https://community.esri.com/t5/attribute-rules-questions/can-an-attribute-rule-passively-perform-an-update/m-p/1479568#M1478</guid>
      <dc:creator>ChristopherBowering</dc:creator>
      <dc:date>2024-05-28T15:00:27Z</dc:date>
    </item>
  </channel>
</rss>

