<?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 Attribute Rule Validation Trouble in ArcGIS Pro Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-questions/attribute-rule-validation-trouble/m-p/1104939#M46380</link>
    <description>&lt;P&gt;I'm trying to set up a calculation attribute rule to populate a general ledger account value based on the contents of some text fields, and I'm running into trouble with validating the rule. My Arcade script works when I run it as a field calculation, as a popup calculation, and even validates in the Expression Builder in the attribute rule setup. When I go to save the rule, I get an error of 002717: Invalid Arcade expression, Arcade error: String type expected, Script line 39 (that's line 18 in the code snippet below). Is this a bug, or is there something I'm doing wrong here? I'm using ArcGIS Pro version 2.8.3.&lt;/P&gt;&lt;P&gt;My code is basically the following. I've shortened the dict and redacted accounts, but you get the idea.&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;//lookup dictionary for account numbers
var accountDict = {
'DISTNonUnionSUV' : '######-####-###',
'DISTNonUnionVan' : '######-####-###',
'DISTNonUnionTruck' : '######-####-###',
'DISTUnionBackhoe' : '######-####-###'
};

//collect values from fields
var vehDept = $feature.Department;
var vehClass = $feature.Class;
var unionStatus = $feature.VehicleType;

//concatenate values to generate key
var accountType = vehDept + unionStatus + vehClass;

//retrieve and return GL Account
var accountNum = accountDict[accountType];
return accountNum;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And proof that it's validating in the expression builder:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="JCGuarneri_0-1633460721954.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/24586iA2C7EAD2376FACCF/image-size/medium?v=v2&amp;amp;px=400" role="button" title="JCGuarneri_0-1633460721954.png" alt="JCGuarneri_0-1633460721954.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 05 Oct 2021 19:12:53 GMT</pubDate>
    <dc:creator>JCGuarneri</dc:creator>
    <dc:date>2021-10-05T19:12:53Z</dc:date>
    <item>
      <title>Attribute Rule Validation Trouble</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/attribute-rule-validation-trouble/m-p/1104939#M46380</link>
      <description>&lt;P&gt;I'm trying to set up a calculation attribute rule to populate a general ledger account value based on the contents of some text fields, and I'm running into trouble with validating the rule. My Arcade script works when I run it as a field calculation, as a popup calculation, and even validates in the Expression Builder in the attribute rule setup. When I go to save the rule, I get an error of 002717: Invalid Arcade expression, Arcade error: String type expected, Script line 39 (that's line 18 in the code snippet below). Is this a bug, or is there something I'm doing wrong here? I'm using ArcGIS Pro version 2.8.3.&lt;/P&gt;&lt;P&gt;My code is basically the following. I've shortened the dict and redacted accounts, but you get the idea.&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;//lookup dictionary for account numbers
var accountDict = {
'DISTNonUnionSUV' : '######-####-###',
'DISTNonUnionVan' : '######-####-###',
'DISTNonUnionTruck' : '######-####-###',
'DISTUnionBackhoe' : '######-####-###'
};

//collect values from fields
var vehDept = $feature.Department;
var vehClass = $feature.Class;
var unionStatus = $feature.VehicleType;

//concatenate values to generate key
var accountType = vehDept + unionStatus + vehClass;

//retrieve and return GL Account
var accountNum = accountDict[accountType];
return accountNum;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And proof that it's validating in the expression builder:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="JCGuarneri_0-1633460721954.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/24586iA2C7EAD2376FACCF/image-size/medium?v=v2&amp;amp;px=400" role="button" title="JCGuarneri_0-1633460721954.png" alt="JCGuarneri_0-1633460721954.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 05 Oct 2021 19:12:53 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/attribute-rule-validation-trouble/m-p/1104939#M46380</guid>
      <dc:creator>JCGuarneri</dc:creator>
      <dc:date>2021-10-05T19:12:53Z</dc:date>
    </item>
  </channel>
</rss>

