<?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 I am encountering an issue with saving an attribute rule in ArcGIS Pro in ArcGIS Pro Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-questions/i-am-encountering-an-issue-with-saving-an/m-p/1418951#M82765</link>
    <description>&lt;P&gt;I have written an attribute rule in Arcade for a feature layer in ArcGIS Pro. The script validates. However, when I attempt to save the attribute rule, I encounter an error message and the rule fails to save. The error message I receive is as follows: error 999999 something unexpected cause the tool to fail when saving attribute rule.&lt;/P&gt;
&lt;P&gt;This script gets the endpoint of the current line featureclass, then determines which point feature layers is connected to the end of the line. Then it grabs a value of the connected point feature and calcs it to the line feature.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'm reaching out to the community for any insights, advice, or troubleshooting tips to help resolve this issue. If anyone has encountered a similar problem or has suggestions for troubleshooting steps, I'd greatly appreciate your input.&lt;/P&gt;
&lt;P&gt;Thanks a lot for your help!&lt;/P&gt;
&lt;P&gt;// Define function to find intersecting point&lt;BR /&gt;function findIntersectingPoint(point, layerName) {&lt;BR /&gt;var fields = ['unitid'];&lt;BR /&gt;var layer_fs = FeatureSetByName($datastore, layerName, fields, true);&lt;BR /&gt;if (IsEmpty(layer_fs)) return null;&lt;BR /&gt;return First(Intersects(point, layer_fs));&lt;BR /&gt;}&lt;/P&gt;
&lt;P&gt;// Main logic&lt;BR /&gt;var result = {};&lt;BR /&gt;var attributes = {};&lt;/P&gt;
&lt;P&gt;// Get the end point of the line&lt;BR /&gt;var line_shape = Geometry($feature);&lt;BR /&gt;var spRef = line_shape['spatialReference'];&lt;BR /&gt;var end_x = line_shape['paths'][-1][-1].x;&lt;BR /&gt;var end_y = line_shape['paths'][-1][-1].y;&lt;BR /&gt;var end_point = Point({x: end_x, y: end_y, spatialReference: spRef});&lt;/P&gt;
&lt;P&gt;// Define layers to check&lt;BR /&gt;var layersToCheck = [&lt;BR /&gt;"xyz.xyz.wwNetworkStructure",&lt;BR /&gt;"xyz.xyz.wwPump",&lt;BR /&gt;"xyz.xyz.wwSystemValve",&lt;BR /&gt;"xyz.xyz.wwManhole",&lt;BR /&gt;"xyz.xyz.wwFitting",&lt;BR /&gt;"xyz.xyz.wwCleanout"&lt;BR /&gt;];&lt;/P&gt;
&lt;P&gt;// Flag to track if a connected layer has been found&lt;BR /&gt;var connectedLayerFound = false;&lt;/P&gt;
&lt;P&gt;// Check which layer is connected to the end point of the line&lt;BR /&gt;for (var i in layersToCheck) {&lt;BR /&gt;var intx = findIntersectingPoint(end_point, layersToCheck[i]);&lt;BR /&gt;if (!IsEmpty(intx)) {&lt;BR /&gt;attributes['UNITID2'] = intx['UNITID'];&lt;BR /&gt;connectedLayerFound = true;&lt;BR /&gt;break;&lt;BR /&gt;}&lt;BR /&gt;}&lt;/P&gt;
&lt;P&gt;// Check if attributes is not empty&lt;BR /&gt;if (connectedLayerFound) {&lt;BR /&gt;result = {&lt;BR /&gt;'attributes': attributes&lt;BR /&gt;};&lt;BR /&gt;}&lt;/P&gt;
&lt;P&gt;//console(result)&lt;BR /&gt;return result;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 28 Jun 2024 16:26:01 GMT</pubDate>
    <dc:creator>JuneAcosta</dc:creator>
    <dc:date>2024-06-28T16:26:01Z</dc:date>
    <item>
      <title>I am encountering an issue with saving an attribute rule in ArcGIS Pro</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/i-am-encountering-an-issue-with-saving-an/m-p/1418951#M82765</link>
      <description>&lt;P&gt;I have written an attribute rule in Arcade for a feature layer in ArcGIS Pro. The script validates. However, when I attempt to save the attribute rule, I encounter an error message and the rule fails to save. The error message I receive is as follows: error 999999 something unexpected cause the tool to fail when saving attribute rule.&lt;/P&gt;
&lt;P&gt;This script gets the endpoint of the current line featureclass, then determines which point feature layers is connected to the end of the line. Then it grabs a value of the connected point feature and calcs it to the line feature.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'm reaching out to the community for any insights, advice, or troubleshooting tips to help resolve this issue. If anyone has encountered a similar problem or has suggestions for troubleshooting steps, I'd greatly appreciate your input.&lt;/P&gt;
&lt;P&gt;Thanks a lot for your help!&lt;/P&gt;
&lt;P&gt;// Define function to find intersecting point&lt;BR /&gt;function findIntersectingPoint(point, layerName) {&lt;BR /&gt;var fields = ['unitid'];&lt;BR /&gt;var layer_fs = FeatureSetByName($datastore, layerName, fields, true);&lt;BR /&gt;if (IsEmpty(layer_fs)) return null;&lt;BR /&gt;return First(Intersects(point, layer_fs));&lt;BR /&gt;}&lt;/P&gt;
&lt;P&gt;// Main logic&lt;BR /&gt;var result = {};&lt;BR /&gt;var attributes = {};&lt;/P&gt;
&lt;P&gt;// Get the end point of the line&lt;BR /&gt;var line_shape = Geometry($feature);&lt;BR /&gt;var spRef = line_shape['spatialReference'];&lt;BR /&gt;var end_x = line_shape['paths'][-1][-1].x;&lt;BR /&gt;var end_y = line_shape['paths'][-1][-1].y;&lt;BR /&gt;var end_point = Point({x: end_x, y: end_y, spatialReference: spRef});&lt;/P&gt;
&lt;P&gt;// Define layers to check&lt;BR /&gt;var layersToCheck = [&lt;BR /&gt;"xyz.xyz.wwNetworkStructure",&lt;BR /&gt;"xyz.xyz.wwPump",&lt;BR /&gt;"xyz.xyz.wwSystemValve",&lt;BR /&gt;"xyz.xyz.wwManhole",&lt;BR /&gt;"xyz.xyz.wwFitting",&lt;BR /&gt;"xyz.xyz.wwCleanout"&lt;BR /&gt;];&lt;/P&gt;
&lt;P&gt;// Flag to track if a connected layer has been found&lt;BR /&gt;var connectedLayerFound = false;&lt;/P&gt;
&lt;P&gt;// Check which layer is connected to the end point of the line&lt;BR /&gt;for (var i in layersToCheck) {&lt;BR /&gt;var intx = findIntersectingPoint(end_point, layersToCheck[i]);&lt;BR /&gt;if (!IsEmpty(intx)) {&lt;BR /&gt;attributes['UNITID2'] = intx['UNITID'];&lt;BR /&gt;connectedLayerFound = true;&lt;BR /&gt;break;&lt;BR /&gt;}&lt;BR /&gt;}&lt;/P&gt;
&lt;P&gt;// Check if attributes is not empty&lt;BR /&gt;if (connectedLayerFound) {&lt;BR /&gt;result = {&lt;BR /&gt;'attributes': attributes&lt;BR /&gt;};&lt;BR /&gt;}&lt;/P&gt;
&lt;P&gt;//console(result)&lt;BR /&gt;return result;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 28 Jun 2024 16:26:01 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/i-am-encountering-an-issue-with-saving-an/m-p/1418951#M82765</guid>
      <dc:creator>JuneAcosta</dc:creator>
      <dc:date>2024-06-28T16:26:01Z</dc:date>
    </item>
    <item>
      <title>Re: I am encountering an issue with saving an attribute rule in ArcGIS Pro</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/i-am-encountering-an-issue-with-saving-an/m-p/1418979#M82772</link>
      <description>&lt;P&gt;Not even going to look at the script, but for starters, if I remember correctly - check that you have GlobalIDs enabled in the feature class. Rules and such like need globals to report.&lt;/P&gt;&lt;P&gt;Of course, given it's 2:30am here, I could be wrong &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 04 May 2024 01:38:38 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/i-am-encountering-an-issue-with-saving-an/m-p/1418979#M82772</guid>
      <dc:creator>JonathanMcD</dc:creator>
      <dc:date>2024-05-04T01:38:38Z</dc:date>
    </item>
    <item>
      <title>Re: I am encountering an issue with saving an attribute rule in ArcGIS Pro</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/i-am-encountering-an-issue-with-saving-an/m-p/1419999#M82909</link>
      <description>&lt;P&gt;I think you might just ran into this issue&amp;nbsp;&lt;A href="https://community.esri.com/t5/attribute-rules-questions/cannot-save-calculation-rule-after-making-any/m-p/1418156#M1428" target="_blank"&gt;https://community.esri.com/t5/attribute-rules-questions/cannot-save-calculation-rule-after-making-any/m-p/1418156#M1428&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 07 May 2024 16:55:31 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/i-am-encountering-an-issue-with-saving-an/m-p/1419999#M82909</guid>
      <dc:creator>HusseinNasser2</dc:creator>
      <dc:date>2024-05-07T16:55:31Z</dc:date>
    </item>
  </channel>
</rss>

