<?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: Data validation with arcade in ArcGIS Pro Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-questions/data-validation-with-arcade/m-p/1367969#M77151</link>
    <description>&lt;P&gt;Glad to help. Don't forget to click the Accept as Solution button on the post that answered your question.&lt;/P&gt;</description>
    <pubDate>Tue, 09 Jan 2024 17:29:06 GMT</pubDate>
    <dc:creator>KenBuja</dc:creator>
    <dc:date>2024-01-09T17:29:06Z</dc:date>
    <item>
      <title>Data validation with arcade</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/data-validation-with-arcade/m-p/1367865#M77139</link>
      <description>&lt;P&gt;Hi there,&lt;/P&gt;&lt;P&gt;I am trying to use attribute rules with Arcade to automate a field when a new attribute is added to my map. I figured out the first part to get my file number to generate:&lt;/P&gt;&lt;P&gt;var date = $feature.date_issued&lt;BR /&gt;var year = Text(Year(date), '0000');&lt;BR /&gt;var month = Text(Month(date), '00');&lt;BR /&gt;var day = Text(Day(date), '00');&lt;BR /&gt;var fileNumber = year + month + day;&lt;/P&gt;&lt;P&gt;return fileNumber;&lt;/P&gt;&lt;P&gt;What I can't seem to figure out is how to validate if that number already exisits in another attribute, and if it does, how to return filenumber + A&amp;nbsp; or +B if A exisits as well. Please let me know if this is possible to do or if I will have to find another way to do it.&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Tue, 09 Jan 2024 14:57:20 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/data-validation-with-arcade/m-p/1367865#M77139</guid>
      <dc:creator>ShaiBravo</dc:creator>
      <dc:date>2024-01-09T14:57:20Z</dc:date>
    </item>
    <item>
      <title>Re: Data validation with arcade</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/data-validation-with-arcade/m-p/1367898#M77142</link>
      <description>&lt;P&gt;This would check whether that value exists and append either an A or B. Don't forget to replace "theField" with the appropriate field name.&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;var date = $feature.date_issued
var year = Text(Year(date), '0000');
var month = Text(Month(date), '00');
var day = Text(Day(date), '00');
var fileNumber = year + month + day;
var fileNumberA = `${fileNumber}A`
when (Count(Filter($featureSet, "theField = @fileNumberA")) &amp;gt; 0, `${fileNumber}B`,
      Count(Filter($featureSet, "theField = @fileNumber")) &amp;gt; 0, fileNumberA,
      fileNumber)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 09 Jan 2024 16:00:36 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/data-validation-with-arcade/m-p/1367898#M77142</guid>
      <dc:creator>KenBuja</dc:creator>
      <dc:date>2024-01-09T16:00:36Z</dc:date>
    </item>
    <item>
      <title>Re: Data validation with arcade</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/data-validation-with-arcade/m-p/1367934#M77146</link>
      <description>&lt;P&gt;Thanks for the reply, not sure if I am doing something incorrect, but when I use the following code, I get the following error returned:&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;var yearn = Text(Now(), 'YYYY');
var monthn = Text(Now(), 'MM');
var dayn = Text(Now(), 'DD');

var fileNumber = yearn + monthn + dayn;
var fileNumberA = `${fileNumber}A`
when (Count(Filter($featureSet, "date_issued = @fileNumberA")) &amp;gt; 0, `${fileNumber}B`,
      Count(Filter($featureSet, "date_issued = @fileNumber")) &amp;gt; 0, fileNumberA,
      fileNumber)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Invalid expression.&lt;BR /&gt;Error on line 7.&lt;BR /&gt;Invalid where clause (date_issued = '20240109A')&lt;/P&gt;</description>
      <pubDate>Tue, 09 Jan 2024 16:56:26 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/data-validation-with-arcade/m-p/1367934#M77146</guid>
      <dc:creator>ShaiBravo</dc:creator>
      <dc:date>2024-01-09T16:56:26Z</dc:date>
    </item>
    <item>
      <title>Re: Data validation with arcade</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/data-validation-with-arcade/m-p/1367947#M77148</link>
      <description>&lt;P&gt;What type of field is "date_issued"? In your first post, it looks like it's a date field. If that's so, then you can't use a string to query it or to put in the result ('20240109A'). I successfully tested my code on a string field.&lt;/P&gt;</description>
      <pubDate>Tue, 09 Jan 2024 17:06:19 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/data-validation-with-arcade/m-p/1367947#M77148</guid>
      <dc:creator>KenBuja</dc:creator>
      <dc:date>2024-01-09T17:06:19Z</dc:date>
    </item>
    <item>
      <title>Re: Data validation with arcade</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/data-validation-with-arcade/m-p/1367963#M77150</link>
      <description>&lt;P&gt;Sorry, I was all turned around. I input the correct field which is a string and it worked! Thanks a ton.&lt;/P&gt;</description>
      <pubDate>Tue, 09 Jan 2024 17:21:05 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/data-validation-with-arcade/m-p/1367963#M77150</guid>
      <dc:creator>ShaiBravo</dc:creator>
      <dc:date>2024-01-09T17:21:05Z</dc:date>
    </item>
    <item>
      <title>Re: Data validation with arcade</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/data-validation-with-arcade/m-p/1367969#M77151</link>
      <description>&lt;P&gt;Glad to help. Don't forget to click the Accept as Solution button on the post that answered your question.&lt;/P&gt;</description>
      <pubDate>Tue, 09 Jan 2024 17:29:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/data-validation-with-arcade/m-p/1367969#M77151</guid>
      <dc:creator>KenBuja</dc:creator>
      <dc:date>2024-01-09T17:29:06Z</dc:date>
    </item>
  </channel>
</rss>

