<?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: Validation Rule to Flag Duplicate Values in Attribute Rules Questions</title>
    <link>https://community.esri.com/t5/attribute-rules-questions/validation-rule-to-flag-duplicate-values/m-p/1088150#M159</link>
    <description>&lt;PRE&gt;&amp;nbsp;//detect duplicate&lt;BR /&gt;var currentAssetId = $feature.assetId&lt;BR /&gt;var currentObjectId = $feature.objectid&lt;BR /&gt;var fsMyClass = FeatureSetByName($datastore, "myclass")&lt;BR /&gt;var fsResult = filter(fsMyClass, "assetid = @currentAssetId and objectid &amp;lt;&amp;gt; @currentObjectId") // search for the same asset id but don't count the current row&lt;BR /&gt;if (first(fsResult) == null)&lt;BR /&gt;return true; //we did not find a duplicate &lt;BR /&gt;else&lt;BR /&gt;return false; //we did find a duplicate create an error feature&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;A bit slow but should work.&lt;/P&gt;&lt;P&gt;Alternatively you can do a summary statistics on the class and detect where count &amp;gt; 1&lt;/P&gt;</description>
    <pubDate>Wed, 11 Aug 2021 21:01:59 GMT</pubDate>
    <dc:creator>HusseinNasser2</dc:creator>
    <dc:date>2021-08-11T21:01:59Z</dc:date>
    <item>
      <title>Validation Rule to Flag Duplicate Values</title>
      <link>https://community.esri.com/t5/attribute-rules-questions/validation-rule-to-flag-duplicate-values/m-p/1088118#M158</link>
      <description>&lt;P&gt;Is it possible to create a validation rule that will flag or warn when a duplicate value is being added in a new feature's attributes? I'm new to Arcade and have very limited Javascript experience. Any input or help on this is greatly appreciated.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 11 Aug 2021 20:13:20 GMT</pubDate>
      <guid>https://community.esri.com/t5/attribute-rules-questions/validation-rule-to-flag-duplicate-values/m-p/1088118#M158</guid>
      <dc:creator>ChrisGAEG</dc:creator>
      <dc:date>2021-08-11T20:13:20Z</dc:date>
    </item>
    <item>
      <title>Re: Validation Rule to Flag Duplicate Values</title>
      <link>https://community.esri.com/t5/attribute-rules-questions/validation-rule-to-flag-duplicate-values/m-p/1088150#M159</link>
      <description>&lt;PRE&gt;&amp;nbsp;//detect duplicate&lt;BR /&gt;var currentAssetId = $feature.assetId&lt;BR /&gt;var currentObjectId = $feature.objectid&lt;BR /&gt;var fsMyClass = FeatureSetByName($datastore, "myclass")&lt;BR /&gt;var fsResult = filter(fsMyClass, "assetid = @currentAssetId and objectid &amp;lt;&amp;gt; @currentObjectId") // search for the same asset id but don't count the current row&lt;BR /&gt;if (first(fsResult) == null)&lt;BR /&gt;return true; //we did not find a duplicate &lt;BR /&gt;else&lt;BR /&gt;return false; //we did find a duplicate create an error feature&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;A bit slow but should work.&lt;/P&gt;&lt;P&gt;Alternatively you can do a summary statistics on the class and detect where count &amp;gt; 1&lt;/P&gt;</description>
      <pubDate>Wed, 11 Aug 2021 21:01:59 GMT</pubDate>
      <guid>https://community.esri.com/t5/attribute-rules-questions/validation-rule-to-flag-duplicate-values/m-p/1088150#M159</guid>
      <dc:creator>HusseinNasser2</dc:creator>
      <dc:date>2021-08-11T21:01:59Z</dc:date>
    </item>
    <item>
      <title>Re: Validation Rule to Flag Duplicate Values</title>
      <link>https://community.esri.com/t5/attribute-rules-questions/validation-rule-to-flag-duplicate-values/m-p/1088222#M160</link>
      <description>&lt;P&gt;Hi Hussein, thanks for you response. I applied the rule to a point fc, but nothing happens when I create a duplicate address. How do I get the flag to trigger? This is how I have the expression. I am testing locally and not on SDE database, before I apply to my orgs database.&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt; //detect duplicate
var currentAssetId = $feature.address
var currentObjectId = $feature.OBJECTID
var fsMyClass = FeatureSetByName($datastore, "Served_Address_copy")
var fsResult = filter(fsMyClass, "address = @currentAssetId and OBJECTID &amp;lt;&amp;gt; @currentObjectId") // search for the same address but don't count the current row
if (first(fsResult) == null)
return true; //we did not find a duplicate 
else
return false; //we did find a duplicate create an error feature&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Are there any other steps I need to take to get this to trigger?&lt;/P&gt;</description>
      <pubDate>Thu, 12 Aug 2021 00:34:54 GMT</pubDate>
      <guid>https://community.esri.com/t5/attribute-rules-questions/validation-rule-to-flag-duplicate-values/m-p/1088222#M160</guid>
      <dc:creator>ChrisGAEG</dc:creator>
      <dc:date>2021-08-12T00:34:54Z</dc:date>
    </item>
    <item>
      <title>Re: Validation Rule to Flag Duplicate Values</title>
      <link>https://community.esri.com/t5/attribute-rules-questions/validation-rule-to-flag-duplicate-values/m-p/1088223#M161</link>
      <description>&lt;P&gt;Yes you will need to use the error inspector to trigger the validation rules. That will create an error feature showing you where the duplicates are&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;watch this youtube video where I show how to create and evaluate. Note that you can run validation rules and batch calculation rules on filegdb.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 12 Aug 2021 00:39:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/attribute-rules-questions/validation-rule-to-flag-duplicate-values/m-p/1088223#M161</guid>
      <dc:creator>HusseinNasser2</dc:creator>
      <dc:date>2021-08-12T00:39:06Z</dc:date>
    </item>
    <item>
      <title>Re: Validation Rule to Flag Duplicate Values</title>
      <link>https://community.esri.com/t5/attribute-rules-questions/validation-rule-to-flag-duplicate-values/m-p/1088228#M162</link>
      <description>&lt;P&gt;After creating the rule, I open the error inspector and when I click on the map (or the layer with the attribution rule) nothing comes up on error inspector. Is there something I'm missing? (I am on an advanced license).&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 12 Aug 2021 01:08:31 GMT</pubDate>
      <guid>https://community.esri.com/t5/attribute-rules-questions/validation-rule-to-flag-duplicate-values/m-p/1088228#M162</guid>
      <dc:creator>ChrisGAEG</dc:creator>
      <dc:date>2021-08-12T01:08:31Z</dc:date>
    </item>
    <item>
      <title>Re: Validation Rule to Flag Duplicate Values</title>
      <link>https://community.esri.com/t5/attribute-rules-questions/validation-rule-to-flag-duplicate-values/m-p/1088229#M163</link>
      <description>&lt;P&gt;Scratch that, I think I figured that part out. I will play with it a bit and see if I can get the rest. Thank you for your help so far.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 12 Aug 2021 01:21:02 GMT</pubDate>
      <guid>https://community.esri.com/t5/attribute-rules-questions/validation-rule-to-flag-duplicate-values/m-p/1088229#M163</guid>
      <dc:creator>ChrisGAEG</dc:creator>
      <dc:date>2021-08-12T01:21:02Z</dc:date>
    </item>
    <item>
      <title>Re: Validation Rule to Flag Duplicate Values</title>
      <link>https://community.esri.com/t5/attribute-rules-questions/validation-rule-to-flag-duplicate-values/m-p/1088606#M171</link>
      <description>&lt;P&gt;Hi Hussein, I have one more question concerning this. How would this code change if made a constraint rule? Would it be drastically different?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 12 Aug 2021 19:29:07 GMT</pubDate>
      <guid>https://community.esri.com/t5/attribute-rules-questions/validation-rule-to-flag-duplicate-values/m-p/1088606#M171</guid>
      <dc:creator>ChrisGAEG</dc:creator>
      <dc:date>2021-08-12T19:29:07Z</dc:date>
    </item>
    <item>
      <title>Re: Validation Rule to Flag Duplicate Values</title>
      <link>https://community.esri.com/t5/attribute-rules-questions/validation-rule-to-flag-duplicate-values/m-p/1088608#M172</link>
      <description>&lt;P&gt;It should be identical&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 12 Aug 2021 19:31:30 GMT</pubDate>
      <guid>https://community.esri.com/t5/attribute-rules-questions/validation-rule-to-flag-duplicate-values/m-p/1088608#M172</guid>
      <dc:creator>HusseinNasser2</dc:creator>
      <dc:date>2021-08-12T19:31:30Z</dc:date>
    </item>
  </channel>
</rss>

