<?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: ADMS Create Site Address point - index error in Attribute Rules Questions</title>
    <link>https://community.esri.com/t5/attribute-rules-questions/adms-create-site-address-point-index-error/m-p/1287261#M884</link>
    <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/127924"&gt;@JamesBurton1&lt;/a&gt;, I see the issue. There is a bug in my script that we don't typically encounter because in the default schema we have the same field name for the addressptid in both the AddressPoint feature class and the SiteAddressPoint feature class. Looking at your script you have a different name:&lt;/P&gt;&lt;P&gt;// Define the Address Points fields&lt;BR /&gt;&lt;FONT color="#FF0000"&gt;var id_field = "addressptid";&lt;/FONT&gt;&lt;BR /&gt;var offdist_field = "offdist";&lt;BR /&gt;var offdir_field = "offdir";&lt;BR /&gt;var numpoints_field = "numpoints";&lt;BR /&gt;var incrementval_field = "incrementval";&lt;BR /&gt;var capturemeth_field = "capturemeth";&lt;/P&gt;&lt;P&gt;// Define the Site Addresses fields&lt;BR /&gt;&lt;FONT color="#FF0000"&gt;var addressptid_field = "addressid";&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;The issue occurs later in the expression when we attempt to create a new SiteAddressPoint, I am referencing the id_field variable from the AddressPoint feature class rather than the addressptid variable for the SiteAddressPoint feature class:&lt;/P&gt;&lt;P&gt;Push(adds, {&lt;BR /&gt;'attributes': Dictionary(&lt;FONT color="#FF0000"&gt;id_field&lt;/FONT&gt;, id, status_field, defaultstatus,&lt;BR /&gt;addrnum_field, addrnum, roadfullname_field, intersectingRoad[fullname_field],&lt;BR /&gt;addrcapturemeth_field, $feature[capturemeth_field]),&lt;BR /&gt;'geometry': newPoint&lt;BR /&gt;})&lt;/P&gt;&lt;P&gt;This is why it is saying the index addressptid doesn't exist, because that field doesn't exist in the SiteAddressPoint feature class. If you change that section of code to below, it should work:&lt;/P&gt;&lt;P&gt;Push(adds, {&lt;BR /&gt;'attributes': Dictionary(&lt;FONT color="#FF0000"&gt;addressptid_field&lt;/FONT&gt;, id, status_field, defaultstatus,&lt;BR /&gt;addrnum_field, addrnum, roadfullname_field, intersectingRoad[fullname_field],&lt;BR /&gt;addrcapturemeth_field, $feature[capturemeth_field]),&lt;BR /&gt;'geometry': newPoint&lt;BR /&gt;})&lt;/P&gt;</description>
    <pubDate>Tue, 09 May 2023 14:46:40 GMT</pubDate>
    <dc:creator>ChrisFox</dc:creator>
    <dc:date>2023-05-09T14:46:40Z</dc:date>
    <item>
      <title>ADMS Create Site Address point - index error</title>
      <link>https://community.esri.com/t5/attribute-rules-questions/adms-create-site-address-point-index-error/m-p/1286709#M879</link>
      <description>&lt;P&gt;Working on the attribute rules in the address data management solution v2. The address point rule "Create Site Address Point" is giving me an error about indexing that it difficult to troubleshoot. It seems like this rule is looking for the addressptid created in the Address Point ID rule but not finding it. Any suggestions on getting one rule to initiate before another? Anyone else seen this error?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="JamesBurton1_0-1683305576730.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/69978i7195EE44B0180844/image-size/medium?v=v2&amp;amp;px=400" role="button" title="JamesBurton1_0-1683305576730.png" alt="JamesBurton1_0-1683305576730.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Here is the rule.&lt;/P&gt;&lt;P&gt;// This rule will create a new site address point when an address point is created along a road&lt;BR /&gt;// The site address point will be offset from the road by the distance and direction defined in the address point feature template&lt;/P&gt;&lt;P&gt;// Define the Address Points fields&lt;BR /&gt;var id_field = "addressptid";&lt;BR /&gt;var offdist_field = "offdist";&lt;BR /&gt;var offdir_field = "offdir";&lt;BR /&gt;var numpoints_field = "numpoints";&lt;BR /&gt;var incrementval_field = "incrementval";&lt;BR /&gt;var capturemeth_field = "capturemeth";&lt;/P&gt;&lt;P&gt;// Define the Site Addresses fields&lt;BR /&gt;var addressptid_field = "addressid";&lt;BR /&gt;var addrnum_field = "housenumber";&lt;BR /&gt;var roadfullname_field = "fullname";&lt;BR /&gt;var status_field = "status";&lt;BR /&gt;var defaultstatus = "Pending";&lt;BR /&gt;var addrcapturemeth_field = "capturemethod";&lt;/P&gt;&lt;P&gt;// Define the Road Centerline fields&lt;BR /&gt;var fromleft_field = "fromaddr_l";&lt;BR /&gt;var fromright_field = "fromaddr_r";&lt;BR /&gt;var toleft_field = "toaddr_l";&lt;BR /&gt;var toright_field = "toaddr_r";&lt;BR /&gt;var fullname_field = "fullname";&lt;/P&gt;&lt;P&gt;// This function will return the new point offset perpendicularly from a 2-point line segment at a specified distance&lt;BR /&gt;// Positive distance is to the left of the line. Negative distance is to the right of the line&lt;BR /&gt;function offsetPoint(firstPoint, secondPoint, fromPoint, dist) {&lt;BR /&gt;var x1 = firstPoint.x;&lt;BR /&gt;var y1 = firstPoint.y;&lt;BR /&gt;var x2 = secondPoint.x;&lt;BR /&gt;var y2 = secondPoint.y;&lt;BR /&gt;var x3 = fromPoint.x;&lt;BR /&gt;var y3 = fromPoint.y;&lt;/P&gt;&lt;P&gt;var a = y1 - y2;&lt;BR /&gt;var b = x2 - x1;&lt;/P&gt;&lt;P&gt;var norm = Sqrt(a*a + b*b);&lt;BR /&gt;a = a / norm;&lt;BR /&gt;b = b / norm;&lt;/P&gt;&lt;P&gt;return [x3 + a * dist, y3 + b * dist]&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;// This function will find the closest point on line_feature from point_feature&lt;BR /&gt;function closestPointInfo(point_feature, line_feature) {&lt;BR /&gt;var vertices = line_feature["paths"]&lt;BR /&gt;var x = point_feature["x"];&lt;BR /&gt;var y = point_feature["y"];&lt;/P&gt;&lt;P&gt;// Loop through each part of the geometry and each segment, tracking the shortest distance&lt;BR /&gt;var shortest = [1e10];&lt;BR /&gt;for (var i in vertices) {&lt;BR /&gt;var part = vertices[i];&lt;BR /&gt;var previous = part[0];&lt;BR /&gt;for (var j = 1; j &amp;lt; Count(part); j++) {&lt;BR /&gt;var current = part[j];&lt;BR /&gt;var result = pDistance(x, y, previous["x"], previous["y"], current["x"], current["y"]);&lt;BR /&gt;if (result[0] &amp;lt; shortest[0]) shortest = result&lt;BR /&gt;previous = current;&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;// Couldn't find anything&lt;BR /&gt;if (Count(shortest) == 1) return null&lt;/P&gt;&lt;P&gt;return {"distance": shortest[0],&lt;BR /&gt;"coordinates": shortest[1],&lt;BR /&gt;"isVertex": shortest[2],&lt;BR /&gt;"lineSide": shortest[3]}&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;// This function will get distance between 2 points&lt;BR /&gt;function pDistance(x, y, x1, y1, x2, y2) {&lt;BR /&gt;var A = x - x1;&lt;BR /&gt;var B = y - y1;&lt;BR /&gt;var C = x2 - x1;&lt;BR /&gt;var D = y2 - y1;&lt;/P&gt;&lt;P&gt;var dot = A * C + B * D;&lt;BR /&gt;var len_sq = C * C + D * D;&lt;BR /&gt;var param = -1;&lt;BR /&gt;if (len_sq != 0) //in case of 0 length line&lt;BR /&gt;param = dot / len_sq;&lt;/P&gt;&lt;P&gt;var xx, yy;&lt;BR /&gt;var is_vertex = true;&lt;BR /&gt;if (param &amp;lt; 0) {&lt;BR /&gt;xx = x1;&lt;BR /&gt;yy = y1;&lt;BR /&gt;}&lt;BR /&gt;else if (param &amp;gt; 1) {&lt;BR /&gt;xx = x2;&lt;BR /&gt;yy = y2;&lt;BR /&gt;}&lt;BR /&gt;else {&lt;BR /&gt;is_vertex = false;&lt;BR /&gt;xx = x1 + param * C;&lt;BR /&gt;yy = y1 + param * D;&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;var dx = x - xx;&lt;BR /&gt;var dy = y - yy;&lt;BR /&gt;return [Sqrt(dx * dx + dy * dy), [xx, yy], is_vertex, sideOfLine(x,y,x1,y1,x2,y2)];&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;// This function will get side of line segment that a point (x, y) is on based on the direction of segment [[x1, y1], [x2, y2]]&lt;BR /&gt;function sideOfLine(x, y, x1, y1, x2, y2) {&lt;/P&gt;&lt;P&gt;var d = (x - x1) * (y2 - y1) - (y - y1) * (x2 - x1)&lt;BR /&gt;if (d &amp;lt; 0) {&lt;BR /&gt;return 'left'&lt;BR /&gt;} else if (d &amp;gt; 0) {&lt;BR /&gt;return 'right'&lt;BR /&gt;} else {&lt;BR /&gt;return null&lt;BR /&gt;}&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;// This function will create point geometry from coordinates [x, y]&lt;BR /&gt;function createPoint(coordinates, spatial_ref) {&lt;BR /&gt;return Point({"x": coordinates[0], "y": coordinates[1], "z" : 0, "spatialReference": spatial_ref})&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;// This function will return the segment intersected and the distance along the line&lt;BR /&gt;function intersectDistanceAlong(sourceGeometry, interestedLine){&lt;BR /&gt;var distanceAlongLine = 0;&lt;BR /&gt;// Loop through the segments of the line. Handle multipart geometries&lt;BR /&gt;for (var part in Geometry(interestedLine).paths) {&lt;BR /&gt;var segment = Geometry(interestedLine).paths[part];&lt;/P&gt;&lt;P&gt;// Loop through the points in the segment&lt;BR /&gt;for (var i in segment) {&lt;BR /&gt;if (i == 0) continue;&lt;/P&gt;&lt;P&gt;// Construct a 2-point line segment from the current and previous point&lt;BR /&gt;var firstPoint = segment[i-1];&lt;BR /&gt;var secondPoint = segment[i]&lt;BR /&gt;var twoPointLine = Polyline({ 'paths' : [[[firstPoint.x, firstPoint.y], [secondPoint.x, secondPoint.y]]], 'spatialReference' : firstPoint.spatialReference});&lt;/P&gt;&lt;P&gt;// Test if the point intersects the 2-point line segment&lt;BR /&gt;if (Intersects(sourceGeometry, twoPointLine)) {&lt;BR /&gt;// Construct a 2-point line segment using the previous point and the address point&lt;BR /&gt;var lastSegment = Polyline({ 'paths' : [[[firstPoint.x, firstPoint.y], [sourceGeometry.x, sourceGeometry.y]]], 'spatialReference' : firstPoint.spatialReference});&lt;BR /&gt;// Add to the total distance along the line and break the loop&lt;BR /&gt;distanceAlongLine += Length(lastSegment);&lt;BR /&gt;return [twoPointLine, distanceAlongLine]&lt;BR /&gt;}&lt;BR /&gt;// Add to the toal distance along the line&lt;BR /&gt;distanceAlongLine += Length(twoPointLine);&lt;BR /&gt;}&lt;BR /&gt;}&lt;BR /&gt;return null;&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;// This function will return the address number of the new site address point&lt;BR /&gt;// It determines this based on the from and to address range on the intersecting road and the direction of the offset&lt;BR /&gt;function getAddrNum(road, percentAlong, dir) {&lt;BR /&gt;var addrNum = null;&lt;BR /&gt;var from = road[fromleft_field];&lt;BR /&gt;var to = road[toleft_field];&lt;BR /&gt;if (Lower(dir) == 'right') {&lt;BR /&gt;var from = road[fromright_field];&lt;BR /&gt;var to = road[toright_field];&lt;BR /&gt;}&lt;BR /&gt;if (from == null || to == null) return null;&lt;BR /&gt;var val = percentAlong * (to - from);&lt;BR /&gt;var addrNum = 0;&lt;BR /&gt;&lt;BR /&gt;if ((Floor(val) % 2) == 0) addrNum = Floor(val);&lt;BR /&gt;else if ((Ceil(val) % 2) == 0) addrNum = Ceil(val);&lt;BR /&gt;else addrNum = Floor(val) - 1;&lt;BR /&gt;&lt;BR /&gt;return from + addrNum;&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;If (!HasKey($feature, id_field)) return;&lt;BR /&gt;var id = $feature[id_field];&lt;/P&gt;&lt;P&gt;// Get the geometry of the feature&lt;BR /&gt;var geom = Geometry($feature);&lt;/P&gt;&lt;P&gt;// Get the distance and direction defined in the address point feature template/&lt;BR /&gt;// If none specified defaults to 0 and Left&lt;BR /&gt;var dist = 0;&lt;BR /&gt;if ($feature[offdist_field] != null) dist = $feature[offdist_field];&lt;BR /&gt;var dir = 'left';&lt;BR /&gt;if ($feature[offdir_field] != null) dir = $feature[offdir_field];&lt;BR /&gt;if (Lower(dir) == 'right') dist *= -1&lt;/P&gt;&lt;P&gt;// Get the number of site address points and increment value from the address point feature template&lt;BR /&gt;// Defaults to 1 and 0 respectively&lt;BR /&gt;var numpoints = 1;&lt;BR /&gt;if ($feature[numpoints_field] != null) numpoints = $feature[numpoints_field];&lt;BR /&gt;var increment = 0;&lt;BR /&gt;if ($feature[incrementval_field] != null) increment = $feature[incrementval_field];&lt;BR /&gt;&lt;BR /&gt;// If not creating any site addresses return&lt;BR /&gt;if (numpoints &amp;lt; 1) return;&lt;BR /&gt;&lt;BR /&gt;// Find any intersecting roads with the address point&lt;BR /&gt;// If no roads intersect, buffer the point to handle cases where point isn't exactly snapped to line and try again&lt;BR /&gt;// If no roads intersect the the buffer return an error message and prevent the address point from being created&lt;BR /&gt;var intersectingRoads = Intersects(FeatureSetByName($datastore, "CenterlinesMSD", [fullname_field, fromleft_field, toleft_field, fromright_field, toright_field], true), geom);&lt;BR /&gt;if (Count(intersectingRoads) == 0) {&lt;BR /&gt;intersectingRoads = Intersects(FeatureSetByName($datastore, "CenterlinesMSD", [fullname_field, fromleft_field, toleft_field, fromright_field, toright_field], true), Buffer(geom, 5));&lt;BR /&gt;if (Count(intersectingRoads) == 0) return { "errorMessage": "Address Point must intersect at least one Road Centerline" }&lt;BR /&gt;}&lt;BR /&gt;var intersectingRoad = First(intersectingRoads);&lt;/P&gt;&lt;P&gt;// Snap the point to the closest place along the line and find the segment it intersects and the distance along the line&lt;BR /&gt;var data = closestPointInfo(geom, Geometry(intersectingRoad));&lt;BR /&gt;var closest_point = createPoint(data["coordinates"], Geometry($feature)["spatialReference"])&lt;BR /&gt;var results = intersectDistanceAlong(closest_point, intersectingRoad)&lt;BR /&gt;var twoPtSegment = results[0];&lt;BR /&gt;var distanceAlongLine = results[1];&lt;/P&gt;&lt;P&gt;// Construct a new point geometry offset perpendicularly from the road&lt;BR /&gt;var xy = offsetPoint(twoPtSegment.paths[0][0], twoPtSegment.paths[0][1], geom, dist)&lt;BR /&gt;var newPoint = Point({ 'x' : xy[0], 'y' : xy[1], 'z' : 0, 'spatialReference' : geom.spatialReference });&lt;/P&gt;&lt;P&gt;// Get the new address number of the site address point based on the distance along the road and direction of the offset&lt;BR /&gt;var percentAlong = distanceAlongLine / Length(intersectingRoad);&lt;BR /&gt;var addrnum = getAddrNum(intersectingRoad, percentAlong, dir)&lt;/P&gt;&lt;P&gt;// Create an array of 1 or more new site address point as specified&lt;BR /&gt;// Store the related address point id, the calculated address number, the intersecting road name and set the status to Pending&lt;BR /&gt;var adds = []&lt;BR /&gt;for(var i=0; i&amp;lt;numpoints; i++) {&lt;BR /&gt;Push(adds, {&lt;BR /&gt;'attributes': Dictionary(id_field, id, status_field, defaultstatus,&lt;BR /&gt;addrnum_field, addrnum, roadfullname_field, intersectingRoad[fullname_field],&lt;BR /&gt;addrcapturemeth_field, $feature[capturemeth_field]),&lt;BR /&gt;'geometry': newPoint&lt;BR /&gt;})&lt;BR /&gt;addrNum += increment;&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;// Create new site address points&lt;BR /&gt;return {&lt;BR /&gt;'edit': [{&lt;BR /&gt;'className': "SiteAddressesMSD",&lt;BR /&gt;'adds': adds&lt;BR /&gt;}]&lt;BR /&gt;}&lt;/P&gt;</description>
      <pubDate>Mon, 08 May 2023 13:53:28 GMT</pubDate>
      <guid>https://community.esri.com/t5/attribute-rules-questions/adms-create-site-address-point-index-error/m-p/1286709#M879</guid>
      <dc:creator>JamesBurton1</dc:creator>
      <dc:date>2023-05-08T13:53:28Z</dc:date>
    </item>
    <item>
      <title>Re: ADMS Create Site Address point - index error</title>
      <link>https://community.esri.com/t5/attribute-rules-questions/adms-create-site-address-point-index-error/m-p/1286854#M880</link>
      <description>&lt;P&gt;I suspect that you need to include an &lt;A href="https://developers.arcgis.com/arcade/function-reference/feature_functions/#expects" target="_self"&gt;Expects&lt;/A&gt; declaration at the top of the attribute rule since fields are being called from $feature via bracket notation.&lt;/P&gt;&lt;P&gt;Try adding this to "Create Site Address Point"&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;Expects($feature, "addressptid", "offdist", "offdir", "numpoints", "incrementval", "capturemeth")&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And this to "Address Point ID"&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;Expects($feature, "addressptid")&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 08 May 2023 17:10:25 GMT</pubDate>
      <guid>https://community.esri.com/t5/attribute-rules-questions/adms-create-site-address-point-index-error/m-p/1286854#M880</guid>
      <dc:creator>TedHoward2</dc:creator>
      <dc:date>2023-05-08T17:10:25Z</dc:date>
    </item>
    <item>
      <title>Re: ADMS Create Site Address point - index error</title>
      <link>https://community.esri.com/t5/attribute-rules-questions/adms-create-site-address-point-index-error/m-p/1286983#M881</link>
      <description>&lt;P&gt;Thanks for the reply&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/147940"&gt;@TedHoward2&lt;/a&gt;. I tried adding these to both rules but I'm still getting the same indexing error.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 08 May 2023 20:10:56 GMT</pubDate>
      <guid>https://community.esri.com/t5/attribute-rules-questions/adms-create-site-address-point-index-error/m-p/1286983#M881</guid>
      <dc:creator>JamesBurton1</dc:creator>
      <dc:date>2023-05-08T20:10:56Z</dc:date>
    </item>
    <item>
      <title>Re: ADMS Create Site Address point - index error</title>
      <link>https://community.esri.com/t5/attribute-rules-questions/adms-create-site-address-point-index-error/m-p/1287035#M882</link>
      <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/74321"&gt;@ChrisFox&lt;/a&gt;&amp;nbsp;have you seen this indexing error before?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 08 May 2023 22:00:56 GMT</pubDate>
      <guid>https://community.esri.com/t5/attribute-rules-questions/adms-create-site-address-point-index-error/m-p/1287035#M882</guid>
      <dc:creator>JamesBurton1</dc:creator>
      <dc:date>2023-05-08T22:00:56Z</dc:date>
    </item>
    <item>
      <title>Re: ADMS Create Site Address point - index error</title>
      <link>https://community.esri.com/t5/attribute-rules-questions/adms-create-site-address-point-index-error/m-p/1287261#M884</link>
      <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/127924"&gt;@JamesBurton1&lt;/a&gt;, I see the issue. There is a bug in my script that we don't typically encounter because in the default schema we have the same field name for the addressptid in both the AddressPoint feature class and the SiteAddressPoint feature class. Looking at your script you have a different name:&lt;/P&gt;&lt;P&gt;// Define the Address Points fields&lt;BR /&gt;&lt;FONT color="#FF0000"&gt;var id_field = "addressptid";&lt;/FONT&gt;&lt;BR /&gt;var offdist_field = "offdist";&lt;BR /&gt;var offdir_field = "offdir";&lt;BR /&gt;var numpoints_field = "numpoints";&lt;BR /&gt;var incrementval_field = "incrementval";&lt;BR /&gt;var capturemeth_field = "capturemeth";&lt;/P&gt;&lt;P&gt;// Define the Site Addresses fields&lt;BR /&gt;&lt;FONT color="#FF0000"&gt;var addressptid_field = "addressid";&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;The issue occurs later in the expression when we attempt to create a new SiteAddressPoint, I am referencing the id_field variable from the AddressPoint feature class rather than the addressptid variable for the SiteAddressPoint feature class:&lt;/P&gt;&lt;P&gt;Push(adds, {&lt;BR /&gt;'attributes': Dictionary(&lt;FONT color="#FF0000"&gt;id_field&lt;/FONT&gt;, id, status_field, defaultstatus,&lt;BR /&gt;addrnum_field, addrnum, roadfullname_field, intersectingRoad[fullname_field],&lt;BR /&gt;addrcapturemeth_field, $feature[capturemeth_field]),&lt;BR /&gt;'geometry': newPoint&lt;BR /&gt;})&lt;/P&gt;&lt;P&gt;This is why it is saying the index addressptid doesn't exist, because that field doesn't exist in the SiteAddressPoint feature class. If you change that section of code to below, it should work:&lt;/P&gt;&lt;P&gt;Push(adds, {&lt;BR /&gt;'attributes': Dictionary(&lt;FONT color="#FF0000"&gt;addressptid_field&lt;/FONT&gt;, id, status_field, defaultstatus,&lt;BR /&gt;addrnum_field, addrnum, roadfullname_field, intersectingRoad[fullname_field],&lt;BR /&gt;addrcapturemeth_field, $feature[capturemeth_field]),&lt;BR /&gt;'geometry': newPoint&lt;BR /&gt;})&lt;/P&gt;</description>
      <pubDate>Tue, 09 May 2023 14:46:40 GMT</pubDate>
      <guid>https://community.esri.com/t5/attribute-rules-questions/adms-create-site-address-point-index-error/m-p/1287261#M884</guid>
      <dc:creator>ChrisFox</dc:creator>
      <dc:date>2023-05-09T14:46:40Z</dc:date>
    </item>
    <item>
      <title>Re: ADMS Create Site Address point - index error</title>
      <link>https://community.esri.com/t5/attribute-rules-questions/adms-create-site-address-point-index-error/m-p/1287263#M885</link>
      <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/127924"&gt;@JamesBurton1&lt;/a&gt;, I see the issue. There is a bug in my script that we don't typically encounter because in the default schema we have the same field name for the addressptid in both the AddressPoint feature class and the SiteAddressPoint feature class. Looking at your script you have a different name:&lt;/P&gt;&lt;P&gt;// Define the Address Points fields&lt;BR /&gt;&lt;FONT color="#FF0000"&gt;var id_field = "addressptid";&lt;/FONT&gt;&lt;BR /&gt;var offdist_field = "offdist";&lt;BR /&gt;var offdir_field = "offdir";&lt;BR /&gt;var numpoints_field = "numpoints";&lt;BR /&gt;var incrementval_field = "incrementval";&lt;BR /&gt;var capturemeth_field = "capturemeth";&lt;/P&gt;&lt;P&gt;// Define the Site Addresses fields&lt;BR /&gt;&lt;FONT color="#FF0000"&gt;var addressptid_field = "addressid";&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;The issue occurs later in the expression when we attempt to create a new SiteAddressPoint, I am referencing the id_field variable from the AddressPoint feature class rather than the addressptid variable for the SiteAddressPoint feature class:&lt;/P&gt;&lt;P&gt;Push(adds, {&lt;BR /&gt;'attributes': Dictionary(&lt;FONT color="#FF0000"&gt;id_field&lt;/FONT&gt;, id, status_field, defaultstatus,&lt;BR /&gt;addrnum_field, addrnum, roadfullname_field, intersectingRoad[fullname_field],&lt;BR /&gt;addrcapturemeth_field, $feature[capturemeth_field]),&lt;BR /&gt;'geometry': newPoint&lt;BR /&gt;})&lt;/P&gt;&lt;P&gt;This is why it is saying the index addressptid doesn't exist, because that field doesn't exist in the SiteAddressPoint feature class. If you change that section of code to below, it should work:&lt;/P&gt;&lt;P&gt;Push(adds, {&lt;BR /&gt;'attributes': Dictionary(&lt;FONT color="#FF0000"&gt;addressptid_field&lt;/FONT&gt;, id, status_field, defaultstatus,&lt;BR /&gt;addrnum_field, addrnum, roadfullname_field, intersectingRoad[fullname_field],&lt;BR /&gt;addrcapturemeth_field, $feature[capturemeth_field]),&lt;BR /&gt;'geometry': newPoint&lt;BR /&gt;})&lt;/P&gt;</description>
      <pubDate>Tue, 09 May 2023 14:49:14 GMT</pubDate>
      <guid>https://community.esri.com/t5/attribute-rules-questions/adms-create-site-address-point-index-error/m-p/1287263#M885</guid>
      <dc:creator>ChrisFox</dc:creator>
      <dc:date>2023-05-09T14:49:14Z</dc:date>
    </item>
    <item>
      <title>Re: ADMS Create Site Address point - index error</title>
      <link>https://community.esri.com/t5/attribute-rules-questions/adms-create-site-address-point-index-error/m-p/1287312#M889</link>
      <description>&lt;P&gt;You're the man&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/74321"&gt;@ChrisFox&lt;/a&gt;, that solved my indexing error. Thanks!&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 09 May 2023 16:05:16 GMT</pubDate>
      <guid>https://community.esri.com/t5/attribute-rules-questions/adms-create-site-address-point-index-error/m-p/1287312#M889</guid>
      <dc:creator>JamesBurton1</dc:creator>
      <dc:date>2023-05-09T16:05:16Z</dc:date>
    </item>
  </channel>
</rss>

