<?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 Parent Geometry to A Related Record in Attribute Rules Questions</title>
    <link>https://community.esri.com/t5/attribute-rules-questions/add-parent-geometry-to-a-related-record/m-p/1596962#M1737</link>
    <description>&lt;P&gt;Try this, enable the update trigger and then just check when the REL_GUID changes&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;if ($originalfeature.REL_GUID == $feature.REL_GUID)
  return
/// related guid from parent in nonspatial table
var rel_guid = $feature.REL_GUID;

// bring in grid feature class to get grid id
var grid_fs = FeatureSetByName($datastore, "Grid_Test", ["GLOBALID", "GRID_ID"], True);

// use filter technique to find matching record
var filtered_grid_fs = Filter(grid_fs, "GLOBALID = &lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/480582"&gt;@REL&lt;/a&gt;_guid");

var first_grid_feat = First(filtered_grid_fs);
if (IsEmpty(first_grid_feat))
{
    return;
}
var grid_id_value = first_grid_feat["GRID_ID"];

// Filter the grid features to find the one matching Grid ID
var filtered_grids = Filter(grid_fs, "GRID_ID = @grid_id_value");

// Retrieve the first grid feature and check
var first_grid = First(filtered_grids);
if (IsEmpty(first_grid))
{
    return;
}


// Assemble the edit that creates the related polygon using grid geometry and attributes from the visit
return {
    "edit": [{
        "className": "Grid_Test_RelatePolygons",
        "adds": [{
            "attributes": {
                "grid_id": grid_id_value // value to hold as an attribute transfer as well
            },
            "geometry": Geometry(first_grid) 
        }]
    }]
};&lt;/LI-CODE&gt;</description>
    <pubDate>Wed, 19 Mar 2025 09:24:31 GMT</pubDate>
    <dc:creator>MikeMillerGIS</dc:creator>
    <dc:date>2025-03-19T09:24:31Z</dc:date>
    <item>
      <title>Add Parent Geometry to A Related Record</title>
      <link>https://community.esri.com/t5/attribute-rules-questions/add-parent-geometry-to-a-related-record/m-p/1596403#M1712</link>
      <description>&lt;P&gt;Here is the scenario I am trying to build out (tried to keep it short - included pics to help out):&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have two polygon feature classes and a nonspatial table.&lt;/P&gt;&lt;P&gt;The first polygon feature class is called "Grid_Test" - it's a tesselation feature of grid cells primarily used for symbology and tracking where crews are in the field.&lt;/P&gt;&lt;P&gt;Then, I have a related nonspatial table called "Work _Items" that stores the different work that is applied in a grid cell. This has a one-to-many relationship with the grid features. One grid cell to many work items. This has an attribute rule that grabs the gird_id from&amp;nbsp;Grid_Test and is set to be the first rule that is run. This rule works perfectly and is shown below for reference.&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;var rel_guid = $feature.REL_GUID

// search for related features
var Grid_feats = FeatureSetByName($datastore, "Grid_Test", ["GLOBALID", "GRID_ID"], false)

var filtered_grid = Filter(Grid_feats, "GLOBALID= @rel_guid")

// no related features found
if(Count(filtered_grid) == 0) {
  return null
}

// related feature(s) found -&amp;gt; return grid id of the first one

else {
    var first_grid = First(filtered_grid);
    return first_grid["GRID_ID"];
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Finally, I have a second polygon feature called "work_grid_related_polygons". &lt;STRONG&gt;This is where the issue occurs.&lt;/STRONG&gt; The intent of this polygon feature class is to be one-to-one with work items and to create polygons as work items are created using the geometry of the parent grid cell. They will be stacked on top of one another as multiple work records are entered for a grid cell, but that's ok; I need this for reporting.&amp;nbsp; I intended to have an attribute rule take care of the transfer of attributes from work items and retrieve the geometry of the parent grid cell and assign it to each record that is added to the&amp;nbsp;work_grid_related_polygons&lt;/P&gt;&lt;P&gt;Below is a graphic of my intended data model - Hopefully it helps.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="datamodel_example.png" style="width: 999px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/128110iF016FD1E80F57AD9/image-size/large?v=v2&amp;amp;px=999" role="button" title="datamodel_example.png" alt="datamodel_example.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is the arcade code I am running to try and accomplish creating the related polygons:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;// related guid from parent in nonspatial table
var rel_guid = $feature.REL_GUID

// bring in grid feature class to get grid id
var Grid_feats = FeatureSetByName($datastore, "Grid_Test", ["GLOBALID", "GRID_ID"], false)

// use filter technique to find matching record
var filtered_grid_for_grid_id = Filter(Grid_feats, "GLOBALID= @rel_guid")

var grid_id_value = null;

// check for no related features found - this should not occur cause a record is being added as related feature but it is a check
if(Count(filtered_grid_for_grid_id) == 0) {
  return {
        "result": "No matching grid found for the given GRID_ID - first step."
    };
}


// related feature(s) found -&amp;gt; return grid id of the first one
else {
    var first_grid_for_id = First(filtered_grid_for_grid_id);
    var grid_id_value = first_grid_for_id["GRID_ID"];
}


// Access the grid features agaib to get geometry - see parameter set to true for geometries
var grid_features = FeatureSetByName($datastore, "Grid_Test", ['*'], true);

// Filter the grid features to find the one matching Grid ID
var filtered_grids = Filter(grid_features, "GRID_ID = @grid_id_value");


// Check if a matching grid was found - again this should not occur because these are related features
if (Count(filtered_grids) == 0) {
    return {
        "result": "No matching grid found for the given GRID_ID. - Second Step"
    };
}

// Retrieve the first grid feature and check
var first_grid = First(filtered_grids);
if (first_grid == null) {
    return {
        "result": "First grid feature is null."
    };
}

// Get the geometry of the first grid feature
var grid_geom = Geometry(first_grid);
if (grid_geom == null) {
    return {
        "result": "Grid geometry is null."
    };
}


// Ensure the geometry object is valid before proceeding
if (TypeOf(grid_geom) != "Polygon" &amp;amp;&amp;amp; TypeOf(grid_geom) != "Polyline" &amp;amp;&amp;amp; TypeOf(grid_geom) != "Point") {
    return {
        "result": "Invalid geometry type: " + TypeOf(grid_geom)
    };
}

// Assemble the edit that creates the related polygon using grid geometry and attributes from the visit
return {
    "edit": [{
        "className": "Grid_Test_RelatePolygons",
        "adds": [{
            "attributes": {
                "grid_id": grid_id_value // value to hold as an attribute transfer as well
            },
            "geometry": grid_geom 
        }]
    }]
};&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This code runs but no records are produced in work_grid_related_polygons. The result that comes out it is "No matching grid found for the given GRID_ID - first step". This is odd because I used the console to do checks, and they returned valid values for attributes and geometry. Also I am able to get the grid_id populated in my nonspatial table with no issues using the same filter technique from the first attribute rule. I made sure to exclude from application evaluation in the settings.&lt;/P&gt;&lt;P&gt;I'm trying to figure out if i have left out some logic in my scenario to try and produce polygons from related features. I think the issue may be with the sequencing of when the transactions occur in the database for related records.&amp;nbsp;&lt;/P&gt;&lt;P&gt;What's odd is the grid_id comes over fine, and as the first rule in the order of operations, it should be there to be picked up and then used for the second rule. I know I did a little overkill by using using the relate guid to get the grid_id at first, but I did so to make sure I was getting the grid_id from the source. It feels like a timing issue when it comes to to how the database transfers a primary to foreign key in a relationship class.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The inspiration came from&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/346994"&gt;@HusseinNasser2&lt;/a&gt;&amp;nbsp;examples using geometry in other attribute rules. Any help would be greatly appreciated.&lt;/P&gt;</description>
      <pubDate>Tue, 18 Mar 2025 00:53:07 GMT</pubDate>
      <guid>https://community.esri.com/t5/attribute-rules-questions/add-parent-geometry-to-a-related-record/m-p/1596403#M1712</guid>
      <dc:creator>PhilipShutler</dc:creator>
      <dc:date>2025-03-18T00:53:07Z</dc:date>
    </item>
    <item>
      <title>Re: Add Parent Geometry to A Related Record</title>
      <link>https://community.esri.com/t5/attribute-rules-questions/add-parent-geometry-to-a-related-record/m-p/1596529#M1715</link>
      <description>&lt;P&gt;Try this:&lt;/P&gt;&lt;P&gt;Should be able to reuse the FeatureSet&lt;/P&gt;&lt;P&gt;Dont call Count if you are going to call first.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;// related guid from parent in nonspatial table
var rel_guid = $feature.REL_GUID;

// bring in grid feature class to get grid id
var grid_fs = FeatureSetByName($datastore, "Grid_Test", ["GLOBALID", "GRID_ID"], True);

// use filter technique to find matching record
var filtered_grid_fs = Filter(grid_fs, "GLOBALID = &lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/480582"&gt;@REL&lt;/a&gt;_guid");

var first_grid_feat = First(filtered_grid_fs);
if (IsEmpty(first_grid_feat))
{
    return;
}
var grid_id_value = first_grid_feat["GRID_ID"];

// Filter the grid features to find the one matching Grid ID
var filtered_grids = Filter(grid_fs, "GRID_ID = @grid_id_value");

// Retrieve the first grid feature and check
var first_grid = First(filtered_grids);
if (IsEmpty(first_grid))
{
    return;
}


// Assemble the edit that creates the related polygon using grid geometry and attributes from the visit
return {
    "edit": [{
        "className": "Grid_Test_RelatePolygons",
        "adds": [{
            "attributes": {
                "grid_id": grid_id_value // value to hold as an attribute transfer as well
            },
            "geometry": Geometry(first_grid) 
        }]
    }]
};&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 18 Mar 2025 13:23:41 GMT</pubDate>
      <guid>https://community.esri.com/t5/attribute-rules-questions/add-parent-geometry-to-a-related-record/m-p/1596529#M1715</guid>
      <dc:creator>MikeMillerGIS</dc:creator>
      <dc:date>2025-03-18T13:23:41Z</dc:date>
    </item>
    <item>
      <title>Re: Add Parent Geometry to A Related Record</title>
      <link>https://community.esri.com/t5/attribute-rules-questions/add-parent-geometry-to-a-related-record/m-p/1596609#M1719</link>
      <description>&lt;P&gt;I replaced my old script with this one and got no errors but the geometry/attribute is still not coming over and transferring to&amp;nbsp;Grid_Test_RelatePolygons.&lt;/P&gt;&lt;P&gt;Whats odd is I know there is a connection to the parent feature because grid_id is populated automatically when I add a new record in the non-spatial table&amp;nbsp;(WorkItemsTest) from the first attribute rule I posted.&lt;/P&gt;&lt;P&gt;See the screenshot of the related record being added to the non-spatail table (WorkItemsTest) - and getting the grid id from the parent feature but not adding anything to&amp;nbsp;Grid_Test_RelatePolygons (symbology is blue)&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="Attribute Rules Test - Screenshot.png" style="width: 998px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/128159i531404D0B584D140/image-size/large?v=v2&amp;amp;px=999" role="button" title="Attribute Rules Test - Screenshot.png" alt="Attribute Rules Test - Screenshot.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;you can see in the attribute table for&amp;nbsp;Grid_Test_RelatePolygons that nothing is being added too.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="Highlight area shows no records." style="width: 562px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/128160i68C5C4CC19386009/image-size/large?v=v2&amp;amp;px=999" role="button" title="Attribute rules test -attribute table screenshot.png" alt="Highlight area shows no records." /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;Highlight area shows no records.&lt;/span&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 18 Mar 2025 15:49:40 GMT</pubDate>
      <guid>https://community.esri.com/t5/attribute-rules-questions/add-parent-geometry-to-a-related-record/m-p/1596609#M1719</guid>
      <dc:creator>PhilipShutler</dc:creator>
      <dc:date>2025-03-18T15:49:40Z</dc:date>
    </item>
    <item>
      <title>Re: Add Parent Geometry to A Related Record</title>
      <link>https://community.esri.com/t5/attribute-rules-questions/add-parent-geometry-to-a-related-record/m-p/1596709#M1723</link>
      <description>&lt;P&gt;If you want to send me a repo case, I can dive in and see what is going on.&lt;/P&gt;&lt;P&gt;mmilller&amp;nbsp;@ esri.com&lt;/P&gt;</description>
      <pubDate>Tue, 18 Mar 2025 17:57:54 GMT</pubDate>
      <guid>https://community.esri.com/t5/attribute-rules-questions/add-parent-geometry-to-a-related-record/m-p/1596709#M1723</guid>
      <dc:creator>MikeMillerGIS</dc:creator>
      <dc:date>2025-03-18T17:57:54Z</dc:date>
    </item>
    <item>
      <title>Re: Add Parent Geometry to A Related Record</title>
      <link>https://community.esri.com/t5/attribute-rules-questions/add-parent-geometry-to-a-related-record/m-p/1596722#M1724</link>
      <description>If you want to email me a repo dataset, happy to dive into it if you want mmiller@esri.com&lt;BR /&gt;</description>
      <pubDate>Tue, 18 Mar 2025 18:25:17 GMT</pubDate>
      <guid>https://community.esri.com/t5/attribute-rules-questions/add-parent-geometry-to-a-related-record/m-p/1596722#M1724</guid>
      <dc:creator>MikeMillerGIS</dc:creator>
      <dc:date>2025-03-18T18:25:17Z</dc:date>
    </item>
    <item>
      <title>Re: Add Parent Geometry to A Related Record</title>
      <link>https://community.esri.com/t5/attribute-rules-questions/add-parent-geometry-to-a-related-record/m-p/1596834#M1726</link>
      <description>&lt;P&gt;Sending it your way.&lt;/P&gt;</description>
      <pubDate>Tue, 18 Mar 2025 21:45:29 GMT</pubDate>
      <guid>https://community.esri.com/t5/attribute-rules-questions/add-parent-geometry-to-a-related-record/m-p/1596834#M1726</guid>
      <dc:creator>PhilipShutler</dc:creator>
      <dc:date>2025-03-18T21:45:29Z</dc:date>
    </item>
    <item>
      <title>Re: Add Parent Geometry to A Related Record</title>
      <link>https://community.esri.com/t5/attribute-rules-questions/add-parent-geometry-to-a-related-record/m-p/1596836#M1727</link>
      <description>&lt;P&gt;&lt;A href="https://www.arcgis.com/home/item.html?id=1af44da97dd04d488a5df67e76337e9d" target="_blank"&gt;https://www.arcgis.com/home/item.html?id=1af44da97dd04d488a5df67e76337e9d&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Project Package&lt;/P&gt;</description>
      <pubDate>Tue, 18 Mar 2025 21:59:20 GMT</pubDate>
      <guid>https://community.esri.com/t5/attribute-rules-questions/add-parent-geometry-to-a-related-record/m-p/1596836#M1727</guid>
      <dc:creator>PhilipShutler</dc:creator>
      <dc:date>2025-03-18T21:59:20Z</dc:date>
    </item>
    <item>
      <title>Re: Add Parent Geometry to A Related Record</title>
      <link>https://community.esri.com/t5/attribute-rules-questions/add-parent-geometry-to-a-related-record/m-p/1596868#M1728</link>
      <description>&lt;P&gt;Worked for me.&amp;nbsp; How are you adding the rel_guid?&amp;nbsp; The rule only fires on insert, so if you add the record and it saves, then you add the rel_guid, that is an update.&amp;nbsp; You might need to add Update trigger event and then code for when that field changes using the $originalfeature.rel_guid != $feature.rel_guid&lt;/P&gt;</description>
      <pubDate>Wed, 19 Mar 2025 00:01:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/attribute-rules-questions/add-parent-geometry-to-a-related-record/m-p/1596868#M1728</guid>
      <dc:creator>MikeMillerGIS</dc:creator>
      <dc:date>2025-03-19T00:01:04Z</dc:date>
    </item>
    <item>
      <title>Re: Add Parent Geometry to A Related Record</title>
      <link>https://community.esri.com/t5/attribute-rules-questions/add-parent-geometry-to-a-related-record/m-p/1596875#M1729</link>
      <description>&lt;P&gt;rel_guid is auto-populated from the relationship class I have set between&amp;nbsp;&lt;SPAN&gt;Grid_Test and&amp;nbsp;Work _Items.&lt;BR /&gt;&lt;BR /&gt;Grid_Test is the origin, and Work _Items is the destination in the relationship class. GlobalID is my primary key and&amp;nbsp;&amp;nbsp;rel_guid&amp;nbsp; is my foreign key.&amp;nbsp;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 19 Mar 2025 00:14:07 GMT</pubDate>
      <guid>https://community.esri.com/t5/attribute-rules-questions/add-parent-geometry-to-a-related-record/m-p/1596875#M1729</guid>
      <dc:creator>PhilipShutler</dc:creator>
      <dc:date>2025-03-19T00:14:07Z</dc:date>
    </item>
    <item>
      <title>Re: Add Parent Geometry to A Related Record</title>
      <link>https://community.esri.com/t5/attribute-rules-questions/add-parent-geometry-to-a-related-record/m-p/1596877#M1730</link>
      <description>&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="PhilipShutler_0-1742343316617.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/128214iF7D869F54A4DB4EB/image-size/medium?v=v2&amp;amp;px=400" role="button" title="PhilipShutler_0-1742343316617.png" alt="PhilipShutler_0-1742343316617.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;these are the properties of my relationship class.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 19 Mar 2025 00:15:56 GMT</pubDate>
      <guid>https://community.esri.com/t5/attribute-rules-questions/add-parent-geometry-to-a-related-record/m-p/1596877#M1730</guid>
      <dc:creator>PhilipShutler</dc:creator>
      <dc:date>2025-03-19T00:15:56Z</dc:date>
    </item>
    <item>
      <title>Re: Add Parent Geometry to A Related Record</title>
      <link>https://community.esri.com/t5/attribute-rules-questions/add-parent-geometry-to-a-related-record/m-p/1596881#M1731</link>
      <description>&lt;P&gt;Ahh, that explains it.&amp;nbsp; I recall an issue with this workflow.&amp;nbsp; The record is created, then the rel guid is updated.&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 19 Mar 2025 00:24:49 GMT</pubDate>
      <guid>https://community.esri.com/t5/attribute-rules-questions/add-parent-geometry-to-a-related-record/m-p/1596881#M1731</guid>
      <dc:creator>MikeMillerGIS</dc:creator>
      <dc:date>2025-03-19T00:24:49Z</dc:date>
    </item>
    <item>
      <title>Re: Add Parent Geometry to A Related Record</title>
      <link>https://community.esri.com/t5/attribute-rules-questions/add-parent-geometry-to-a-related-record/m-p/1596892#M1732</link>
      <description>&lt;P&gt;Is it an issue with the sequencing of a transaction of a related features being processed in a geodatabase? The relationship class is in place to make it easy for field crews to add related records in field maps - when we use it on our enterprise gdb. I'm not sure if there is a workaround to build this same functionality in field maps without a relationship class.&lt;/P&gt;</description>
      <pubDate>Wed, 19 Mar 2025 00:58:02 GMT</pubDate>
      <guid>https://community.esri.com/t5/attribute-rules-questions/add-parent-geometry-to-a-related-record/m-p/1596892#M1732</guid>
      <dc:creator>PhilipShutler</dc:creator>
      <dc:date>2025-03-19T00:58:02Z</dc:date>
    </item>
    <item>
      <title>Re: Add Parent Geometry to A Related Record</title>
      <link>https://community.esri.com/t5/attribute-rules-questions/add-parent-geometry-to-a-related-record/m-p/1596894#M1733</link>
      <description>&lt;P&gt;Enable the update event, and&amp;nbsp; when $originalfeature.rel_guid == $feature.rel_guid return&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 19 Mar 2025 01:30:30 GMT</pubDate>
      <guid>https://community.esri.com/t5/attribute-rules-questions/add-parent-geometry-to-a-related-record/m-p/1596894#M1733</guid>
      <dc:creator>MikeMillerGIS</dc:creator>
      <dc:date>2025-03-19T01:30:30Z</dc:date>
    </item>
    <item>
      <title>Re: Add Parent Geometry to A Related Record</title>
      <link>https://community.esri.com/t5/attribute-rules-questions/add-parent-geometry-to-a-related-record/m-p/1596962#M1737</link>
      <description>&lt;P&gt;Try this, enable the update trigger and then just check when the REL_GUID changes&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;if ($originalfeature.REL_GUID == $feature.REL_GUID)
  return
/// related guid from parent in nonspatial table
var rel_guid = $feature.REL_GUID;

// bring in grid feature class to get grid id
var grid_fs = FeatureSetByName($datastore, "Grid_Test", ["GLOBALID", "GRID_ID"], True);

// use filter technique to find matching record
var filtered_grid_fs = Filter(grid_fs, "GLOBALID = &lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/480582"&gt;@REL&lt;/a&gt;_guid");

var first_grid_feat = First(filtered_grid_fs);
if (IsEmpty(first_grid_feat))
{
    return;
}
var grid_id_value = first_grid_feat["GRID_ID"];

// Filter the grid features to find the one matching Grid ID
var filtered_grids = Filter(grid_fs, "GRID_ID = @grid_id_value");

// Retrieve the first grid feature and check
var first_grid = First(filtered_grids);
if (IsEmpty(first_grid))
{
    return;
}


// Assemble the edit that creates the related polygon using grid geometry and attributes from the visit
return {
    "edit": [{
        "className": "Grid_Test_RelatePolygons",
        "adds": [{
            "attributes": {
                "grid_id": grid_id_value // value to hold as an attribute transfer as well
            },
            "geometry": Geometry(first_grid) 
        }]
    }]
};&lt;/LI-CODE&gt;</description>
      <pubDate>Wed, 19 Mar 2025 09:24:31 GMT</pubDate>
      <guid>https://community.esri.com/t5/attribute-rules-questions/add-parent-geometry-to-a-related-record/m-p/1596962#M1737</guid>
      <dc:creator>MikeMillerGIS</dc:creator>
      <dc:date>2025-03-19T09:24:31Z</dc:date>
    </item>
    <item>
      <title>Re: Add Parent Geometry to A Related Record</title>
      <link>https://community.esri.com/t5/attribute-rules-questions/add-parent-geometry-to-a-related-record/m-p/1598571#M1742</link>
      <description>&lt;P&gt;Adding the&amp;nbsp;&lt;STRONG&gt;$originalfeature&amp;nbsp;&lt;/STRONG&gt;is what did it! Thanks&lt;/P&gt;&lt;P&gt;My understanding is that the related guids need to equal one another to push the trigger.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 24 Mar 2025 16:16:43 GMT</pubDate>
      <guid>https://community.esri.com/t5/attribute-rules-questions/add-parent-geometry-to-a-related-record/m-p/1598571#M1742</guid>
      <dc:creator>PhilipShutler</dc:creator>
      <dc:date>2025-03-24T16:16:43Z</dc:date>
    </item>
    <item>
      <title>Re: Add Parent Geometry to A Related Record</title>
      <link>https://community.esri.com/t5/attribute-rules-questions/add-parent-geometry-to-a-related-record/m-p/1615340#M1764</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I have a similar issue.&lt;/P&gt;&lt;P&gt;I would like to create geometry for a child (related) record based on parent feature record.&amp;nbsp; Where is the script supposed to be run?&amp;nbsp; I have created a relationship class in Pro and published into AGOL. I would to achieve it in AGOL. Thanks.&lt;/P&gt;</description>
      <pubDate>Fri, 16 May 2025 08:23:58 GMT</pubDate>
      <guid>https://community.esri.com/t5/attribute-rules-questions/add-parent-geometry-to-a-related-record/m-p/1615340#M1764</guid>
      <dc:creator>AkiyoshiKawamura1</dc:creator>
      <dc:date>2025-05-16T08:23:58Z</dc:date>
    </item>
    <item>
      <title>Re: Add Parent Geometry to A Related Record</title>
      <link>https://community.esri.com/t5/attribute-rules-questions/add-parent-geometry-to-a-related-record/m-p/1615401#M1765</link>
      <description>&lt;P&gt;Attribute Rules are not supported in ArcGIS Online.&amp;nbsp; Forms support Arcade, but that profile does not allow the ability to insert rows into other classes.&lt;/P&gt;</description>
      <pubDate>Fri, 16 May 2025 11:53:40 GMT</pubDate>
      <guid>https://community.esri.com/t5/attribute-rules-questions/add-parent-geometry-to-a-related-record/m-p/1615401#M1765</guid>
      <dc:creator>MikeMillerGIS</dc:creator>
      <dc:date>2025-05-16T11:53:40Z</dc:date>
    </item>
  </channel>
</rss>

