<?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 problem with feature layer with attachment  in ArcMap Questions</title>
    <link>https://community.esri.com/t5/arcmap-questions/attribute-rule-problem-with-feature-layer-with/m-p/205735#M492</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&amp;nbsp;&lt;A href="https://community.esri.com/migrated-users/216536"&gt;Jana Košábková&lt;/A&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In this specific case I would recommend to contact Esri Support to have them check what is happening. I have not seen this behavior before, and it almost looks like two requests are made when using a WAB.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am also wondering why you don't make use of a database sequence:&amp;nbsp;&lt;A class="link-titled" href="https://pro.arcgis.com/en/pro-app/tool-reference/data-management/create-database-sequence.htm" title="https://pro.arcgis.com/en/pro-app/tool-reference/data-management/create-database-sequence.htm"&gt;Create Database Sequence—Data Management toolbox | Documentation&lt;/A&gt;&amp;nbsp; then you can use Arcade to get the next number from the sequence. In this link you can see how&amp;nbsp;it is used in combination with the&amp;nbsp;&lt;EM&gt;NextSequenceValue&lt;/EM&gt; function&amp;nbsp;&lt;A class="link-titled" href="https://pro.arcgis.com/en/pro-app/help/data/geodatabases/overview/attribute-rule-script-expression.htm" title="https://pro.arcgis.com/en/pro-app/help/data/geodatabases/overview/attribute-rule-script-expression.htm"&gt;Attribute rule script expression examples—Geodatabases | Documentation&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 09 Jun 2020 13:40:41 GMT</pubDate>
    <dc:creator>XanderBakker</dc:creator>
    <dc:date>2020-06-09T13:40:41Z</dc:date>
    <item>
      <title>Attribute rule problem with feature layer with attachment</title>
      <link>https://community.esri.com/t5/arcmap-questions/attribute-rule-problem-with-feature-layer-with/m-p/205734#M491</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi there,&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have an issue with very simple (as i hoped) attribute rule, which should calculate number to a new feature. The number should be just one higher than maximal value found in the attribute. Here is my arcade:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if ($feature.created_date != $feature.last_edited_date&amp;amp;&amp;amp;$feature.last_edited_user!="GIS") return $feature.cislo&lt;BR /&gt;var stanoviska = FeatureSetByName($datastore,'gisdata_sde.gis.UUP_zavazna_stanoviska_p',['cislo'], true)&lt;BR /&gt;var max_cislo = Max(stanoviska, 'cislo')&lt;BR /&gt;return ++max_cislo&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Funny thing. Everything seems okay, when i draw new feature in ArcGIS Pro it calculates value for field "&lt;EM&gt;cislo&lt;/EM&gt;" well (just one higher). But when I draw new feature in Web App (from WebAppBuilder) using both Edit or smart editor widget the value in field "&lt;EM&gt;cislo"&lt;/EM&gt;&amp;nbsp;counts +2. I found out that the rule works well when the feature class doesn't have attachments but I need to work with FC with attachments. Is there any solution for this issue? It's kind of driving me crazy.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Data are stored in SDE geodatabase as polygon feature class with attachments enabled and is published as service to arcgis server 10.7.1 (federated with portal). And attribute&amp;nbsp;&lt;EM&gt;cislo&lt;/EM&gt; is type of short integer (i also tried long integer and text).&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Every help is appreciated.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Jane&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 09 Jun 2020 11:20:15 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcmap-questions/attribute-rule-problem-with-feature-layer-with/m-p/205734#M491</guid>
      <dc:creator>JanaKošábková</dc:creator>
      <dc:date>2020-06-09T11:20:15Z</dc:date>
    </item>
    <item>
      <title>Re: Attribute rule problem with feature layer with attachment</title>
      <link>https://community.esri.com/t5/arcmap-questions/attribute-rule-problem-with-feature-layer-with/m-p/205735#M492</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&amp;nbsp;&lt;A href="https://community.esri.com/migrated-users/216536"&gt;Jana Košábková&lt;/A&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In this specific case I would recommend to contact Esri Support to have them check what is happening. I have not seen this behavior before, and it almost looks like two requests are made when using a WAB.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am also wondering why you don't make use of a database sequence:&amp;nbsp;&lt;A class="link-titled" href="https://pro.arcgis.com/en/pro-app/tool-reference/data-management/create-database-sequence.htm" title="https://pro.arcgis.com/en/pro-app/tool-reference/data-management/create-database-sequence.htm"&gt;Create Database Sequence—Data Management toolbox | Documentation&lt;/A&gt;&amp;nbsp; then you can use Arcade to get the next number from the sequence. In this link you can see how&amp;nbsp;it is used in combination with the&amp;nbsp;&lt;EM&gt;NextSequenceValue&lt;/EM&gt; function&amp;nbsp;&lt;A class="link-titled" href="https://pro.arcgis.com/en/pro-app/help/data/geodatabases/overview/attribute-rule-script-expression.htm" title="https://pro.arcgis.com/en/pro-app/help/data/geodatabases/overview/attribute-rule-script-expression.htm"&gt;Attribute rule script expression examples—Geodatabases | Documentation&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 09 Jun 2020 13:40:41 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcmap-questions/attribute-rule-problem-with-feature-layer-with/m-p/205735#M492</guid>
      <dc:creator>XanderBakker</dc:creator>
      <dc:date>2020-06-09T13:40:41Z</dc:date>
    </item>
    <item>
      <title>Re: Attribute rule problem with feature layer with attachment</title>
      <link>https://community.esri.com/t5/arcmap-questions/attribute-rule-problem-with-feature-layer-with/m-p/205736#M493</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Xander,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;well, I'll try to contact our local technical support. Hopefully someone will help me.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I also tried database sequence and it worked well until we found out that when someone delete last feature with a specific number (555 for example), next drawn feature will get next number 556 (not 555 as we need). We just need complete numeric serie without gaps. If you have any other idea how to solve this problem, I'd be happy.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Jane&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 Jun 2020 08:05:44 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcmap-questions/attribute-rule-problem-with-feature-layer-with/m-p/205736#M493</guid>
      <dc:creator>AdministrátorJihlava</dc:creator>
      <dc:date>2020-06-10T08:05:44Z</dc:date>
    </item>
    <item>
      <title>Re: Attribute rule problem with feature layer with attachment</title>
      <link>https://community.esri.com/t5/arcmap-questions/attribute-rule-problem-with-feature-layer-with/m-p/205737#M494</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&amp;nbsp;&lt;A href="https://community.esri.com/migrated-users/248012" target="_blank"&gt;Administrátor Jihlava&lt;/A&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for clarifying that you need to have a continuous range of values. It is important to realice that your current Arcade expression will not do that. It will take the highest number and&amp;nbsp;take the next number. If any intermediate value&amp;nbsp;will be deleted this will remain a gap. To get the first available number is to use something like this (I did not test it so it probably will need some tweaking):&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="comment token"&gt;// use any additional  logic before this&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;var&lt;/SPAN&gt; stanoviska &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="token function"&gt;OrderBy&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;FeatureSetByName&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;$datastore&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;'gisdata_sde.gis.UUP_zavazna_stanoviska_p'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;'cislo'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;true&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'cislo ASC'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;

&lt;SPAN class="keyword token"&gt;var&lt;/SPAN&gt; i &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;1&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt; &lt;SPAN class="comment token"&gt;// specify where the cislo code starts, I assumed 1&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;for&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="keyword token"&gt;var&lt;/SPAN&gt; f &lt;SPAN class="keyword token"&gt;in&lt;/SPAN&gt; stanoviska&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
    cislo &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; f&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;cislo&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
    &lt;SPAN class="keyword token"&gt;if&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;cislo &lt;SPAN class="operator token"&gt;&amp;gt;&lt;/SPAN&gt; i &lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
        &lt;SPAN class="keyword token"&gt;return&lt;/SPAN&gt; i&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
    &lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;
    i&lt;SPAN class="operator token"&gt;++&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;
&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 10:11:16 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcmap-questions/attribute-rule-problem-with-feature-layer-with/m-p/205737#M494</guid>
      <dc:creator>XanderBakker</dc:creator>
      <dc:date>2021-12-11T10:11:16Z</dc:date>
    </item>
  </channel>
</rss>

