<?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: Strange attribute rule behaviour in ArcGIS Pro Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-questions/strange-attribute-rule-behaviour/m-p/1591128#M93595</link>
    <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/721900"&gt;@GeeteshSingh07&lt;/a&gt;&amp;nbsp;Thanks for the reply.&lt;/P&gt;&lt;P&gt;The 'Nummer' field does not have a default value and it's set to not nullable, so that's why the value is 0 and not null.&lt;/P&gt;&lt;P&gt;I've also tried to use the fully qualified name of the sequence like so:&lt;/P&gt;&lt;LI-CODE lang="c"&gt;if (IsEmpty($feature.BusinessKey) || $feature.BusinessKey == 0) {
    return NextSequenceValue("Gismo.S_STOPPOINT_BUSINESSKEY")
}
return $feature.BusinessKey&lt;/LI-CODE&gt;&lt;P&gt;But with same result.&lt;/P&gt;</description>
    <pubDate>Mon, 03 Mar 2025 06:38:55 GMT</pubDate>
    <dc:creator>CarstenAndersson</dc:creator>
    <dc:date>2025-03-03T06:38:55Z</dc:date>
    <item>
      <title>Strange attribute rule behaviour</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/strange-attribute-rule-behaviour/m-p/1589950#M93478</link>
      <description>&lt;P&gt;I have a feature service that points to a feature class called StopPoints (&lt;EM&gt;"Stoppunkter" in Danish&lt;/EM&gt;) in a SDE database (SQL Server).&amp;nbsp; The feature class has an immediate attribute rule, that gets the next value from a database sequence and sets it to a field called BusinessKey (&lt;EM&gt;"Nummer" in Danish&lt;/EM&gt;), if it isn't already set to a value.&lt;/P&gt;&lt;P&gt;The attribute rule looks like so:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="c"&gt;if (IsEmpty($feature.BusinessKey) || $feature.BusinessKey == 0) {
    return NextSequenceValue("S_STOPPOINT_BUSINESSKEY")
}
return $feature.BusinessKey&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This rule is triggered by &lt;STRONG&gt;Insert&lt;/STRONG&gt;. I have checked &lt;STRONG&gt;Exclude by application evaluation&lt;/STRONG&gt;. Directly after I've created the feature I query the table using SQL Server Management Studio, and I can see that the newly created row has the BusinessKey set to the next sequence value.&lt;/P&gt;&lt;P&gt;But for some reason, sometimes the BusinessKey is zero in the attribute pane and other times it's the value from the sequence. It seems like the number of layers has something to do with it, but I don't understand why that should be the case.&lt;/P&gt;&lt;P&gt;In this example the BusinessKey (Nummer) is zero:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="CarstenAndersson_0-1740651064304.png" style="width: 436px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/126471i1B2985D1A956150B/image-dimensions/436x266?v=v2" width="436" height="266" role="button" title="CarstenAndersson_0-1740651064304.png" alt="CarstenAndersson_0-1740651064304.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;The feature service looks like so:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="CarstenAndersson_1-1740651095128.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/126472i4B90471FE0341B02/image-size/medium?v=v2&amp;amp;px=400" role="button" title="CarstenAndersson_1-1740651095128.png" alt="CarstenAndersson_1-1740651095128.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;In this case the BusinessKey is not zero:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="CarstenAndersson_2-1740652010612.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/126473i49E74B62FC6DB75A/image-size/medium?v=v2&amp;amp;px=400" role="button" title="CarstenAndersson_2-1740652010612.png" alt="CarstenAndersson_2-1740652010612.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;And the feature service has these layers now:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="CarstenAndersson_3-1740652310053.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/126474i43F8563479A85C7A/image-size/medium?v=v2&amp;amp;px=400" role="button" title="CarstenAndersson_3-1740652310053.png" alt="CarstenAndersson_3-1740652310053.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;It is worth mentioning that the two layers I removed has no attribute rules, triggers or any kind of calculation.&lt;/P&gt;&lt;P&gt;I don't understand this, so any help is greatly appreciated &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 27 Feb 2025 12:01:33 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/strange-attribute-rule-behaviour/m-p/1589950#M93478</guid>
      <dc:creator>CarstenAndersson</dc:creator>
      <dc:date>2025-02-27T12:01:33Z</dc:date>
    </item>
    <item>
      <title>Re: Strange attribute rule behaviour</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/strange-attribute-rule-behaviour/m-p/1589993#M93481</link>
      <description>&lt;P&gt;And as I mentioned, even though it &lt;STRONG&gt;sometimes&lt;/STRONG&gt; looks like the BusinessKey is zero&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="CarstenAndersson_0-1740659515849.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/126480i80EDE8FA1848D9FE/image-size/medium?v=v2&amp;amp;px=400" role="button" title="CarstenAndersson_0-1740659515849.png" alt="CarstenAndersson_0-1740659515849.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;It's actually another value in the table in the SQL database&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="CarstenAndersson_1-1740659613172.png" style="width: 641px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/126481iA51100B76DD1ECEF/image-dimensions/641x132?v=v2" width="641" height="132" role="button" title="CarstenAndersson_1-1740659613172.png" alt="CarstenAndersson_1-1740659613172.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 27 Feb 2025 12:34:08 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/strange-attribute-rule-behaviour/m-p/1589993#M93481</guid>
      <dc:creator>CarstenAndersson</dc:creator>
      <dc:date>2025-02-27T12:34:08Z</dc:date>
    </item>
    <item>
      <title>Re: Strange attribute rule behaviour</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/strange-attribute-rule-behaviour/m-p/1590473#M93544</link>
      <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/350353"&gt;@CarstenAndersson&lt;/a&gt;&amp;nbsp;By any chance, does 'Nummer' field have any default value set in ArcGIS Pro?&amp;nbsp;&lt;BR /&gt;If assigning sequence fails, it should have given &amp;lt;Null&amp;gt;; however, it is giving zero.&lt;BR /&gt;&lt;BR /&gt;You can also check this out:&lt;/P&gt;&lt;P&gt;BUG-000124487: An immediate calculation rule calling a database sequence using the NextSequenceValue() function in ArcGIS Arcade only works for the schema owner of the database sequence and fails for other database users.&lt;/P&gt;&lt;P&gt;&lt;A href="https://support.esri.com/en-us/bug/an-immediate-calculation-rule-calling-a-database-sequen-bug-000124487" target="_blank"&gt;BUG-000124487 for ArcGIS Pro&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 28 Feb 2025 01:47:51 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/strange-attribute-rule-behaviour/m-p/1590473#M93544</guid>
      <dc:creator>GeeteshSingh07</dc:creator>
      <dc:date>2025-02-28T01:47:51Z</dc:date>
    </item>
    <item>
      <title>Re: Strange attribute rule behaviour</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/strange-attribute-rule-behaviour/m-p/1591128#M93595</link>
      <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/721900"&gt;@GeeteshSingh07&lt;/a&gt;&amp;nbsp;Thanks for the reply.&lt;/P&gt;&lt;P&gt;The 'Nummer' field does not have a default value and it's set to not nullable, so that's why the value is 0 and not null.&lt;/P&gt;&lt;P&gt;I've also tried to use the fully qualified name of the sequence like so:&lt;/P&gt;&lt;LI-CODE lang="c"&gt;if (IsEmpty($feature.BusinessKey) || $feature.BusinessKey == 0) {
    return NextSequenceValue("Gismo.S_STOPPOINT_BUSINESSKEY")
}
return $feature.BusinessKey&lt;/LI-CODE&gt;&lt;P&gt;But with same result.&lt;/P&gt;</description>
      <pubDate>Mon, 03 Mar 2025 06:38:55 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/strange-attribute-rule-behaviour/m-p/1591128#M93595</guid>
      <dc:creator>CarstenAndersson</dc:creator>
      <dc:date>2025-03-03T06:38:55Z</dc:date>
    </item>
    <item>
      <title>Re: Strange attribute rule behaviour</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/strange-attribute-rule-behaviour/m-p/1592636#M93723</link>
      <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/350353"&gt;@CarstenAndersson&lt;/a&gt;&amp;nbsp;, also did you test with schema owner&amp;nbsp;&lt;SPAN&gt;of the database sequence?&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 06 Mar 2025 06:13:53 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/strange-attribute-rule-behaviour/m-p/1592636#M93723</guid>
      <dc:creator>GeeteshSingh07</dc:creator>
      <dc:date>2025-03-06T06:13:53Z</dc:date>
    </item>
    <item>
      <title>Re: Strange attribute rule behaviour</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/strange-attribute-rule-behaviour/m-p/1592656#M93725</link>
      <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/721900"&gt;@GeeteshSingh07&lt;/a&gt;&amp;nbsp;Yes. Gismo is the schema owner&lt;/P&gt;</description>
      <pubDate>Thu, 06 Mar 2025 07:26:14 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/strange-attribute-rule-behaviour/m-p/1592656#M93725</guid>
      <dc:creator>CarstenAndersson</dc:creator>
      <dc:date>2025-03-06T07:26:14Z</dc:date>
    </item>
    <item>
      <title>Re: Strange attribute rule behaviour</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/strange-attribute-rule-behaviour/m-p/1592680#M93726</link>
      <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/350353"&gt;@CarstenAndersson&lt;/a&gt;&amp;nbsp;even after refreshing the layer or reopening ArcGIS Pro, it appears 0?&lt;/P&gt;&lt;P&gt;What if we restart the service, does it still appear 0?&amp;nbsp;&lt;BR /&gt;If yes, then, there is a mismatch between Oracle table and EGDB, which is weird, and it shouldn't happen.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 06 Mar 2025 09:40:19 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/strange-attribute-rule-behaviour/m-p/1592680#M93726</guid>
      <dc:creator>GeeteshSingh07</dc:creator>
      <dc:date>2025-03-06T09:40:19Z</dc:date>
    </item>
    <item>
      <title>Re: Strange attribute rule behaviour</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/strange-attribute-rule-behaviour/m-p/1592692#M93729</link>
      <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/504408"&gt;@GeeteshSingh7&lt;/a&gt;&amp;nbsp;The 'Nummer' field is actually set in the database (SQL Server, not Oracle). So, when I save and restart ArcGIS Pro I can see the value. But, I need to see it immediately.&lt;/P&gt;</description>
      <pubDate>Thu, 06 Mar 2025 11:28:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/strange-attribute-rule-behaviour/m-p/1592692#M93729</guid>
      <dc:creator>CarstenAndersson</dc:creator>
      <dc:date>2025-03-06T11:28:04Z</dc:date>
    </item>
  </channel>
</rss>

