<?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 Attribute Rule to split and also copy from backup in Attribute Rules Questions</title>
    <link>https://community.esri.com/t5/attribute-rules-questions/attribute-rule-to-split-and-also-copy-from-backup/m-p/1405522#M1382</link>
    <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I am trying to write 1 or a series of attribute rules that populate my unqiueID in my feature class.&amp;nbsp; I have a sequence set up and I am trying to create the attribute rules that will follow these basic guidelines:&lt;/P&gt;&lt;P&gt;1. If I create a brand new feature - a new ID is calculated&lt;/P&gt;&lt;P&gt;2. If I split a feature (line or polygon) the longest or largest will maintain the existing ID, but the shortest or smaller feature will get a new ID&lt;/P&gt;&lt;P&gt;3. If I copy in 1 feature from a backup file - it will maintain the ID that I have in the backup file.&amp;nbsp; This is to mimic a scenario if we accidently delete a feature - we can recover it and maintain the original ID.&amp;nbsp;&lt;/P&gt;&lt;P&gt;The issue that I am having mainly is I can get the split OR the copy from backup to work, but not both using the same rule.&lt;/P&gt;&lt;P&gt;Eg. This works for new features and splitting features - but if I copy an old feature (that has a FacilityID value) in from a backup Feature Class, it gives it the next value.&lt;BR /&gt;&lt;FONT color="#FF0000"&gt;&lt;EM&gt;var new_facid = "TP" + NextSequenceValue('myID')&lt;/EM&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#FF0000"&gt;&lt;EM&gt;return new_facid&lt;/EM&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;OR&lt;/P&gt;&lt;P&gt;Eg. This works for new features and copying data in from a old feature (that has a FACILITYID value) from a backup Feature Class, but doesn't create a new values for the smaller area on a split.&lt;BR /&gt;&lt;FONT color="#FF0000"&gt;&lt;EM&gt;if (IsEmpty($feature.FACILITYID)) {&lt;/EM&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#FF0000"&gt;&lt;EM&gt;var new_facid = "TP" + NextSequenceValue('myID')&lt;/EM&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#FF0000"&gt;&lt;EM&gt;} else {&lt;/EM&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#FF0000"&gt;&lt;EM&gt;var new_facid = $feature.FACILITYID&lt;/EM&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#FF0000"&gt;&lt;EM&gt;}&lt;/EM&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#FF0000"&gt;&lt;EM&gt;return new_facid&lt;/EM&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;Has anyone had any success with a setup like this?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Darryl&lt;/P&gt;</description>
    <pubDate>Thu, 04 Apr 2024 16:42:27 GMT</pubDate>
    <dc:creator>DarrylKlassen1</dc:creator>
    <dc:date>2024-04-04T16:42:27Z</dc:date>
    <item>
      <title>Attribute Rule to split and also copy from backup</title>
      <link>https://community.esri.com/t5/attribute-rules-questions/attribute-rule-to-split-and-also-copy-from-backup/m-p/1405522#M1382</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I am trying to write 1 or a series of attribute rules that populate my unqiueID in my feature class.&amp;nbsp; I have a sequence set up and I am trying to create the attribute rules that will follow these basic guidelines:&lt;/P&gt;&lt;P&gt;1. If I create a brand new feature - a new ID is calculated&lt;/P&gt;&lt;P&gt;2. If I split a feature (line or polygon) the longest or largest will maintain the existing ID, but the shortest or smaller feature will get a new ID&lt;/P&gt;&lt;P&gt;3. If I copy in 1 feature from a backup file - it will maintain the ID that I have in the backup file.&amp;nbsp; This is to mimic a scenario if we accidently delete a feature - we can recover it and maintain the original ID.&amp;nbsp;&lt;/P&gt;&lt;P&gt;The issue that I am having mainly is I can get the split OR the copy from backup to work, but not both using the same rule.&lt;/P&gt;&lt;P&gt;Eg. This works for new features and splitting features - but if I copy an old feature (that has a FacilityID value) in from a backup Feature Class, it gives it the next value.&lt;BR /&gt;&lt;FONT color="#FF0000"&gt;&lt;EM&gt;var new_facid = "TP" + NextSequenceValue('myID')&lt;/EM&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#FF0000"&gt;&lt;EM&gt;return new_facid&lt;/EM&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;OR&lt;/P&gt;&lt;P&gt;Eg. This works for new features and copying data in from a old feature (that has a FACILITYID value) from a backup Feature Class, but doesn't create a new values for the smaller area on a split.&lt;BR /&gt;&lt;FONT color="#FF0000"&gt;&lt;EM&gt;if (IsEmpty($feature.FACILITYID)) {&lt;/EM&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#FF0000"&gt;&lt;EM&gt;var new_facid = "TP" + NextSequenceValue('myID')&lt;/EM&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#FF0000"&gt;&lt;EM&gt;} else {&lt;/EM&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#FF0000"&gt;&lt;EM&gt;var new_facid = $feature.FACILITYID&lt;/EM&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#FF0000"&gt;&lt;EM&gt;}&lt;/EM&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#FF0000"&gt;&lt;EM&gt;return new_facid&lt;/EM&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;Has anyone had any success with a setup like this?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Darryl&lt;/P&gt;</description>
      <pubDate>Thu, 04 Apr 2024 16:42:27 GMT</pubDate>
      <guid>https://community.esri.com/t5/attribute-rules-questions/attribute-rule-to-split-and-also-copy-from-backup/m-p/1405522#M1382</guid>
      <dc:creator>DarrylKlassen1</dc:creator>
      <dc:date>2024-04-04T16:42:27Z</dc:date>
    </item>
  </channel>
</rss>

