<?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 Rules: error running NextSequenceValue in ArcGIS Pro Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-questions/attribute-rules-error-running-nextsequencevalue/m-p/1063720#M41526</link>
    <description>&lt;P&gt;Johannes,&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you so much for the reply! I appreciate you showing me how to insert the code sample. Thanks for clarifying matchedZone is a feature set. Using your revision, I got my attribute rule to work the way I want. The only thing I had to change was removing the inputSequenceName variable and directly including the 'ManholeSequence' + Text(matchedZone.GRID) in the NextSequenceValue function. When I passed in the variable, it threw a null return error. Anyways, it's working now, so thanks again for the help!&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;// Create reference to the Quarter Section layer in the map
var zones = FeatureSetByName($datastore,"QuarterSection",["GRID"],true)

// Get a feature set of zones that intersect the point
var intersectingZones = Intersects(zones, Geometry($feature))

// Select the first record in the feature set
var matchedZone = First(intersectingZones)

// Return the grid value of the selected zone with the sequence number
return IIf(IsEmpty(matchedZone), null, matchedZone.GRID + "-" + NextSequenceValue("ManholeSequence"+Text(matchedZone.GRID)))&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 01 Jun 2021 17:42:01 GMT</pubDate>
    <dc:creator>asiegel_AWWD</dc:creator>
    <dc:date>2021-06-01T17:42:01Z</dc:date>
    <item>
      <title>Attribute Rules: error running NextSequenceValue</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/attribute-rules-error-running-nextsequencevalue/m-p/1062728#M41432</link>
      <description>&lt;P&gt;I am trying to create an attribute rule for a point feature class (Manholes) in which I want a field (FacilityID) to populate based on the combination of intersection with a polygon grid (Quarter Section) and a Database Sequence. For example, if I create a new point feature in grid 564 and the point is the 55th point in grid 564, I want the attribute rule to populate the FacilityID field with 564-55. I also want this rule to work with any grid, each which has its own Database Sequence counting the number of points. Here is what I have so far:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="asiegel_AWWD_0-1622176273607.png" style="width: 999px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/14470i5913B9AA607CA743/image-size/large?v=v2&amp;amp;px=999" role="button" title="asiegel_AWWD_0-1622176273607.png" alt="asiegel_AWWD_0-1622176273607.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;This script fails with the following error:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="asiegel_AWWD_1-1622176306764.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/14472i608FD23701CF85A4/image-size/medium?v=v2&amp;amp;px=400" role="button" title="asiegel_AWWD_1-1622176306764.png" alt="asiegel_AWWD_1-1622176306764.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;However, the script works if I hardcode the Database Sequence string name into line 12:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="asiegel_AWWD_2-1622176432658.png" style="width: 999px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/14474i68AA68826E324FDD/image-size/large?v=v2&amp;amp;px=999" role="button" title="asiegel_AWWD_2-1622176432658.png" alt="asiegel_AWWD_2-1622176432658.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Does anyone know what might be causing the inputSequenceName to fail when passed into the NextSequenceValue instead of the hard coded string?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'd appreciate any help you can provide since this is my first time diving into Attribute Rules with Arcade. Thanks!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 28 May 2021 15:51:37 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/attribute-rules-error-running-nextsequencevalue/m-p/1062728#M41432</guid>
      <dc:creator>asiegel_AWWD</dc:creator>
      <dc:date>2021-05-28T15:51:37Z</dc:date>
    </item>
    <item>
      <title>Re: Attribute Rules: error running NextSequenceValue</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/attribute-rules-error-running-nextsequencevalue/m-p/1063274#M41475</link>
      <description>&lt;P&gt;It's hard to copy code from screen grabs. In the future, please use the "Insert Code Sample" button in the comment window: Expand the toolbar, then click this button and chose Javascript as language.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="JohannesLindner_0-1622460109513.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/14617i6027E81C24ED335F/image-size/medium?v=v2&amp;amp;px=400" role="button" title="JohannesLindner_0-1622460109513.png" alt="JohannesLindner_0-1622460109513.png" /&gt;&lt;/span&gt;&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;// The error is in this line
var inputSequenceName = 'ManholeSequence' + Text(matchedZone)

// matchedZone is a feature set, not a field!
// Try this:
var inputSequenceName = 'ManholeSequence' + Text(matchedZone.GRID)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 31 May 2021 11:28:05 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/attribute-rules-error-running-nextsequencevalue/m-p/1063274#M41475</guid>
      <dc:creator>JohannesLindner</dc:creator>
      <dc:date>2021-05-31T11:28:05Z</dc:date>
    </item>
    <item>
      <title>Re: Attribute Rules: error running NextSequenceValue</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/attribute-rules-error-running-nextsequencevalue/m-p/1063720#M41526</link>
      <description>&lt;P&gt;Johannes,&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you so much for the reply! I appreciate you showing me how to insert the code sample. Thanks for clarifying matchedZone is a feature set. Using your revision, I got my attribute rule to work the way I want. The only thing I had to change was removing the inputSequenceName variable and directly including the 'ManholeSequence' + Text(matchedZone.GRID) in the NextSequenceValue function. When I passed in the variable, it threw a null return error. Anyways, it's working now, so thanks again for the help!&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;// Create reference to the Quarter Section layer in the map
var zones = FeatureSetByName($datastore,"QuarterSection",["GRID"],true)

// Get a feature set of zones that intersect the point
var intersectingZones = Intersects(zones, Geometry($feature))

// Select the first record in the feature set
var matchedZone = First(intersectingZones)

// Return the grid value of the selected zone with the sequence number
return IIf(IsEmpty(matchedZone), null, matchedZone.GRID + "-" + NextSequenceValue("ManholeSequence"+Text(matchedZone.GRID)))&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 01 Jun 2021 17:42:01 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/attribute-rules-error-running-nextsequencevalue/m-p/1063720#M41526</guid>
      <dc:creator>asiegel_AWWD</dc:creator>
      <dc:date>2021-06-01T17:42:01Z</dc:date>
    </item>
  </channel>
</rss>

