<?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 update two tables in Attribute Rules Questions</title>
    <link>https://community.esri.com/t5/attribute-rules-questions/attribute-rule-update-two-tables/m-p/1551257#M1608</link>
    <description>&lt;P&gt;Ken,&lt;/P&gt;&lt;P&gt;Thanks for your help. I am now getting a new error.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Update table row failed.&lt;BR /&gt;Required keyword is not defined in the dictionary return script. [&lt;BR /&gt;Rule name: ADA_Update,&lt;BR /&gt;Triggering event: Update,&lt;BR /&gt;Class name: BaseData.DBO.Building,&lt;BR /&gt;GlobalID: {E1222E13-8220-4987-A30A-5186B0E09C10}]Required keyword is not defined in the dictionary return script. [Missing keyword 'objectID or globalID' in the 'updates' array or dictionary.]&lt;/P&gt;</description>
    <pubDate>Wed, 23 Oct 2024 13:05:14 GMT</pubDate>
    <dc:creator>Mr_Kirkwood</dc:creator>
    <dc:date>2024-10-23T13:05:14Z</dc:date>
    <item>
      <title>Attribute Rule update two tables</title>
      <link>https://community.esri.com/t5/attribute-rules-questions/attribute-rule-update-two-tables/m-p/1551084#M1606</link>
      <description>&lt;P&gt;I am new to Arcade and attribute rules. I am trying to update on table and have it update anothertable. I am using the example here:&lt;/P&gt;&lt;P&gt;&lt;A title="An Attribute Rule to keep two geodatabase tables in sync" href="https://www.esri.com/arcgis-blog/products/arcgis-pro/data-management/an-attribute-rule-to-keep-two-geodatabase-tables-in-sync/" target="_blank" rel="noopener"&gt;An Attribute Rule to keep two geodatabase tables in sync&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My test SDE database is named BaseData. In there is a Feature Dataset named&amp;nbsp;BaseData.DBO.InVision. There are two layers one is BaseData.DBO.Building and the other is BaseData.DBO.BuildingFloor. They both share a unique ID called&amp;nbsp;&lt;SPAN&gt;BUILDINGKEY. I am trying to sync the attribute Description. here is my Arcade code:&lt;/SPAN&gt;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;if ($editContext.editType == "UPDATE") {
    //we are updating the row, in this table, so we need to get the corrsponding row in the second table and update it. 
    var id = $feature.BUILDINGKEY;
    var fs = FeatureSetByName($datastore, "BaseData.DBO.BuildingFloor");
    var destinationRow = first(Filter(fs, "id = &lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/354972"&gt;@ID&lt;/a&gt;"));
    //this should not happen but catching it just in case
    if (destinationRow == null) return { "errorMessage": "table out of sync!, we tried to update a row that doesn't exist in the other table.. something is wrong." }
    //we can relax that and create the row instead to sync it .
    //we need to prevent the update if all fields are the same (otherwise we will be in an infinite cycle
    if (destinationRow.DESCRIPTION == $feature.DESCRIPTION) return; //no change quit
    //else lets sync them! 
    return {
        "edit": [
            {
                "className": "BaseData.DBO.BuildingFloor",
                "updates": [{
                    "globalID": destinationRow.globalId,
                    "attributes": {
                        "DESCRIPTION": $feature.DESCRIPTION
                    }
                }]
            }]
    }
}&lt;/LI-CODE&gt;&lt;P&gt;I get this error when i try and update:&lt;/P&gt;&lt;P&gt;Update table row failed.&lt;BR /&gt;Failed to evaluate Arcade expression. [&lt;BR /&gt;Rule name: ADA_Update,&lt;BR /&gt;Triggering event: Update,&lt;BR /&gt;Class name: BaseData.DBO.Building,&lt;BR /&gt;GlobalID: {E1222E13-8220-4987-A30A-5186B0E09C10},&lt;BR /&gt;Arcade error: Field not found id,&lt;BR /&gt;Script line: 5]&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If anyone has any ideas i would appreciate the help. thank you.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 22 Oct 2024 20:30:09 GMT</pubDate>
      <guid>https://community.esri.com/t5/attribute-rules-questions/attribute-rule-update-two-tables/m-p/1551084#M1606</guid>
      <dc:creator>Mr_Kirkwood</dc:creator>
      <dc:date>2024-10-22T20:30:09Z</dc:date>
    </item>
    <item>
      <title>Re: Attribute Rule update two tables</title>
      <link>https://community.esri.com/t5/attribute-rules-questions/attribute-rule-update-two-tables/m-p/1551218#M1607</link>
      <description>&lt;P&gt;If they both have the unique ID in the field BUILDINGKEY, then line 5 should be&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;var destinationRow = first(Filter(fs, "BUILDINGKEY = &lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/354972"&gt;@ID&lt;/a&gt;"));&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 23 Oct 2024 12:32:48 GMT</pubDate>
      <guid>https://community.esri.com/t5/attribute-rules-questions/attribute-rule-update-two-tables/m-p/1551218#M1607</guid>
      <dc:creator>KenBuja</dc:creator>
      <dc:date>2024-10-23T12:32:48Z</dc:date>
    </item>
    <item>
      <title>Re: Attribute Rule update two tables</title>
      <link>https://community.esri.com/t5/attribute-rules-questions/attribute-rule-update-two-tables/m-p/1551257#M1608</link>
      <description>&lt;P&gt;Ken,&lt;/P&gt;&lt;P&gt;Thanks for your help. I am now getting a new error.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Update table row failed.&lt;BR /&gt;Required keyword is not defined in the dictionary return script. [&lt;BR /&gt;Rule name: ADA_Update,&lt;BR /&gt;Triggering event: Update,&lt;BR /&gt;Class name: BaseData.DBO.Building,&lt;BR /&gt;GlobalID: {E1222E13-8220-4987-A30A-5186B0E09C10}]Required keyword is not defined in the dictionary return script. [Missing keyword 'objectID or globalID' in the 'updates' array or dictionary.]&lt;/P&gt;</description>
      <pubDate>Wed, 23 Oct 2024 13:05:14 GMT</pubDate>
      <guid>https://community.esri.com/t5/attribute-rules-questions/attribute-rule-update-two-tables/m-p/1551257#M1608</guid>
      <dc:creator>Mr_Kirkwood</dc:creator>
      <dc:date>2024-10-23T13:05:14Z</dc:date>
    </item>
    <item>
      <title>Re: Attribute Rule update two tables</title>
      <link>https://community.esri.com/t5/attribute-rules-questions/attribute-rule-update-two-tables/m-p/1551619#M1609</link>
      <description>&lt;P&gt;Ken&lt;/P&gt;&lt;P&gt;How do i get it to work on 1 to many records. Ex 1 building to many floors?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 28 Oct 2024 13:30:27 GMT</pubDate>
      <guid>https://community.esri.com/t5/attribute-rules-questions/attribute-rule-update-two-tables/m-p/1551619#M1609</guid>
      <dc:creator>Mr_Kirkwood</dc:creator>
      <dc:date>2024-10-28T13:30:27Z</dc:date>
    </item>
    <item>
      <title>Re: Attribute Rule update two tables</title>
      <link>https://community.esri.com/t5/attribute-rules-questions/attribute-rule-update-two-tables/m-p/1552486#M1611</link>
      <description>&lt;P&gt;Ken,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I got it to work. For some reason i had a globalId that wasnt the officail globalID. So i fixed that.The next question is. The Building layer is related to the floor layer where i am puching the changes. When i edit it updates one row only. For example, the Geology building has four floors nad it update the 1st record for the Geology floors but not the otehr three. Do i have to create some sort of array?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 25 Oct 2024 18:28:07 GMT</pubDate>
      <guid>https://community.esri.com/t5/attribute-rules-questions/attribute-rule-update-two-tables/m-p/1552486#M1611</guid>
      <dc:creator>Mr_Kirkwood</dc:creator>
      <dc:date>2024-10-25T18:28:07Z</dc:date>
    </item>
  </channel>
</rss>

