<?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 when splitting a line in ArcGIS Utility Network Questions</title>
    <link>https://community.esri.com/t5/arcgis-utility-network-questions/attribute-rule-when-splitting-a-line/m-p/1345141#M3012</link>
    <description>&lt;P&gt;Does the above code work when digitizing completely new line features?&lt;/P&gt;</description>
    <pubDate>Thu, 02 Nov 2023 17:58:00 GMT</pubDate>
    <dc:creator>TobeyKane-Seitz</dc:creator>
    <dc:date>2023-11-02T17:58:00Z</dc:date>
    <item>
      <title>Attribute Rule when splitting a line</title>
      <link>https://community.esri.com/t5/arcgis-utility-network-questions/attribute-rule-when-splitting-a-line/m-p/1345103#M3009</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I am looking for an Attribute Rule that would allow me to split a line (water main) and for one segment retain the original unique ID and the other segment, get the next available ID. Is that doable?&lt;/P&gt;&lt;P&gt;Any guidance would be much appreciated.&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;P&gt;D&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="DominicRoberge2_0-1698944868615.png" style="width: 638px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/84864i5F13A53F5810E861/image-dimensions/638x351?v=v2" width="638" height="351" role="button" title="DominicRoberge2_0-1698944868615.png" alt="DominicRoberge2_0-1698944868615.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="DominicRoberge2_1-1698944930248.png" style="width: 639px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/84865i634621638BB99012/image-dimensions/639x297?v=v2" width="639" height="297" role="button" title="DominicRoberge2_1-1698944930248.png" alt="DominicRoberge2_1-1698944930248.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 02 Nov 2023 17:12:32 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-utility-network-questions/attribute-rule-when-splitting-a-line/m-p/1345103#M3009</guid>
      <dc:creator>DominicRobergeIADOT</dc:creator>
      <dc:date>2023-11-02T17:12:32Z</dc:date>
    </item>
    <item>
      <title>Re: Attribute Rule when splitting a line</title>
      <link>https://community.esri.com/t5/arcgis-utility-network-questions/attribute-rule-when-splitting-a-line/m-p/1345120#M3010</link>
      <description>&lt;P&gt;If you have an attribute rule setup that assigns a new ID "on insert", the action of splitting the line should cause the shorter segment of the line to be created as a new feature, which would trigger the attribute rule and give that line segment a new ID. The longer segment of the original line would retain the original ID.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 02 Nov 2023 17:27:16 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-utility-network-questions/attribute-rule-when-splitting-a-line/m-p/1345120#M3010</guid>
      <dc:creator>TobeyKane-Seitz</dc:creator>
      <dc:date>2023-11-02T17:27:16Z</dc:date>
    </item>
    <item>
      <title>Re: Attribute Rule when splitting a line</title>
      <link>https://community.esri.com/t5/arcgis-utility-network-questions/attribute-rule-when-splitting-a-line/m-p/1345137#M3011</link>
      <description>&lt;P&gt;that doesn't seem to be working for me. Below is the code I am using (which is from the UN water foundation)&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;LI-CODE lang="javascript"&gt;var assigned_to_field = $feature.FUID;
var id_selector_value = $feature.assetgroup;

function get_id(selector_value) {
    var id_format = {}
    var seq_val = null;
    var selector_value_txt = Text(selector_value)
    if (selector_value_txt == '1') {
                            id_format = {
                                'prefix': "DRSQ1",
                                'join_char': '',
                                'suffix': ''
                            }
                            seq_val = NextSequenceValue('DR_DB_SEQ_1');
                        }else if (selector_value_txt == '50') {
                            id_format = {
                                'prefix': "Wr-Jnctn",
                                'join_char': '-',
                                'suffix': ''
                            }
                            seq_val = NextSequenceValue('W_J_Wr_Jnctn_50_seq');
                        }else if (selector_value_txt == '51') {
                            id_format = {
                                'prefix': "Insltn-Jnctn",
                                'join_char': '-',
                                'suffix': ''
                            }
                            seq_val = NextSequenceValue('W_J_Insltn_Jnctn_51_seq');
                        } else {
        return null;
    }
        var id_parts = remove_empty([id_format['prefix'], seq_val, id_format['suffix']])
        return   id_format['prefix'] + Text(seq_val , "00000")
    }
// ************* End User Variables Section *************

// *************       Functions            *************
function remove_empty(arr) {
   var new_arr = [];
   var j = 0;
   for (var i = 0; i &amp;lt; Count(arr); i++) {
       if (!IsEmpty(arr[i]) &amp;amp;&amp;amp; arr[i] != '') {
           new_arr[j++] = arr[i];
       }
   }
   return new_arr;
}

// ************* End Functions Section *****************


if (IsEmpty(assigned_to_field) == false &amp;amp;&amp;amp; assigned_to_field != '') {
            return assigned_to_field
}
var new_id = get_id(id_selector_value)

if (IsEmpty(new_id)) {
    return assigned_to_field;
}

return new_id&lt;/LI-CODE&gt;&lt;P&gt;(&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 02 Nov 2023 17:54:40 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-utility-network-questions/attribute-rule-when-splitting-a-line/m-p/1345137#M3011</guid>
      <dc:creator>DominicRobergeIADOT</dc:creator>
      <dc:date>2023-11-02T17:54:40Z</dc:date>
    </item>
    <item>
      <title>Re: Attribute Rule when splitting a line</title>
      <link>https://community.esri.com/t5/arcgis-utility-network-questions/attribute-rule-when-splitting-a-line/m-p/1345141#M3012</link>
      <description>&lt;P&gt;Does the above code work when digitizing completely new line features?&lt;/P&gt;</description>
      <pubDate>Thu, 02 Nov 2023 17:58:00 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-utility-network-questions/attribute-rule-when-splitting-a-line/m-p/1345141#M3012</guid>
      <dc:creator>TobeyKane-Seitz</dc:creator>
      <dc:date>2023-11-02T17:58:00Z</dc:date>
    </item>
    <item>
      <title>Re: Attribute Rule when splitting a line</title>
      <link>https://community.esri.com/t5/arcgis-utility-network-questions/attribute-rule-when-splitting-a-line/m-p/1345153#M3013</link>
      <description>&lt;P&gt;Yes, if I create a new line, no problem I get the next UID as expected. The issue is when splitting a line .&lt;/P&gt;</description>
      <pubDate>Thu, 02 Nov 2023 18:09:33 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-utility-network-questions/attribute-rule-when-splitting-a-line/m-p/1345153#M3013</guid>
      <dc:creator>DominicRobergeIADOT</dc:creator>
      <dc:date>2023-11-02T18:09:33Z</dc:date>
    </item>
    <item>
      <title>Re: Attribute Rule when splitting a line</title>
      <link>https://community.esri.com/t5/arcgis-utility-network-questions/attribute-rule-when-splitting-a-line/m-p/1345169#M3014</link>
      <description>&lt;P&gt;I just tested it, and I think it's failing because of lines 52-54. If the field already has an ID value, it doesn't get overwritten. If it's empty, it gets a new ID. Try commenting out those lines and splitting the line.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 02 Nov 2023 18:28:57 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-utility-network-questions/attribute-rule-when-splitting-a-line/m-p/1345169#M3014</guid>
      <dc:creator>TobeyKane-Seitz</dc:creator>
      <dc:date>2023-11-02T18:28:57Z</dc:date>
    </item>
    <item>
      <title>Re: Attribute Rule when splitting a line</title>
      <link>https://community.esri.com/t5/arcgis-utility-network-questions/attribute-rule-when-splitting-a-line/m-p/1345178#M3015</link>
      <description>&lt;P&gt;Thank you! That did the trick. I though I had tested it before but I guess not.&lt;span class="lia-unicode-emoji" title=":rolling_on_the_floor_laughing:"&gt;🤣&lt;/span&gt;&lt;/P&gt;&lt;P&gt;D&lt;/P&gt;</description>
      <pubDate>Thu, 02 Nov 2023 18:36:17 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-utility-network-questions/attribute-rule-when-splitting-a-line/m-p/1345178#M3015</guid>
      <dc:creator>DominicRobergeIADOT</dc:creator>
      <dc:date>2023-11-02T18:36:17Z</dc:date>
    </item>
  </channel>
</rss>

