<?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 on update field: &amp;quot;The field type is not supported by arcade script.&amp;quot; in Attribute Rules Questions</title>
    <link>https://community.esri.com/t5/attribute-rules-questions/attribute-rules-on-update-field-quot-the-field/m-p/1558726#M1620</link>
    <description>&lt;P&gt;Can you post your script? It would be helpful to see what it's returning&lt;/P&gt;</description>
    <pubDate>Thu, 14 Nov 2024 16:49:14 GMT</pubDate>
    <dc:creator>KenBuja</dc:creator>
    <dc:date>2024-11-14T16:49:14Z</dc:date>
    <item>
      <title>Attribute rules on update field: "The field type is not supported by arcade script."</title>
      <link>https://community.esri.com/t5/attribute-rules-questions/attribute-rules-on-update-field-quot-the-field/m-p/1558599#M1619</link>
      <description>&lt;P&gt;I am trying to apply an attribute rule that would update the parent table of two related tables when the child table is edited. In this case I only want to write the number of related records into the parent table but I am getting this error:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="DrNicsi_0-1731593259838.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/119527i277BDD3EB5D127FD/image-size/medium?v=v2&amp;amp;px=400" role="button" title="DrNicsi_0-1731593259838.png" alt="DrNicsi_0-1731593259838.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Initiall the field I am trying to write to was of the type short, now I created fields in long, float and double format but none of them are accepted. How can I find out which field type would be supported for my script?&lt;/P&gt;</description>
      <pubDate>Thu, 14 Nov 2024 14:13:01 GMT</pubDate>
      <guid>https://community.esri.com/t5/attribute-rules-questions/attribute-rules-on-update-field-quot-the-field/m-p/1558599#M1619</guid>
      <dc:creator>DrNicsi</dc:creator>
      <dc:date>2024-11-14T14:13:01Z</dc:date>
    </item>
    <item>
      <title>Re: Attribute rules on update field: "The field type is not supported by arcade script."</title>
      <link>https://community.esri.com/t5/attribute-rules-questions/attribute-rules-on-update-field-quot-the-field/m-p/1558726#M1620</link>
      <description>&lt;P&gt;Can you post your script? It would be helpful to see what it's returning&lt;/P&gt;</description>
      <pubDate>Thu, 14 Nov 2024 16:49:14 GMT</pubDate>
      <guid>https://community.esri.com/t5/attribute-rules-questions/attribute-rules-on-update-field-quot-the-field/m-p/1558726#M1620</guid>
      <dc:creator>KenBuja</dc:creator>
      <dc:date>2024-11-14T16:49:14Z</dc:date>
    </item>
    <item>
      <title>Re: Attribute rules on update field: "The field type is not supported by arcade script."</title>
      <link>https://community.esri.com/t5/attribute-rules-questions/attribute-rules-on-update-field-quot-the-field/m-p/1558772#M1621</link>
      <description>&lt;P&gt;Here it is, with bpmis_data being the child table and bpmis_distinct the parent table:&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;var select="upi='"+$feature["upi"] +"'";
var fs = FeatureSetbyName($datastore, "bpmis.sde.bpmis_data")
var upi_filtered=Filter(fs,select);
var cnt=Count(upi_filtered)

if (cnt&amp;gt;0){
return {
    "result": cnt,
    "edit": [
         {
          "className":"bpmis.sde.bpmis_distinct",
          "updates":[
              {
              "upi":  $feature["upi"],
              "attributes": {
                  "permits_cnt": cnt
                  }
              }
            ]
         }  
       ]
    }
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When I try it in the popup I get the expected result (&lt;SPAN&gt;"permits_cnt":14 (number obviously depending on the feature)&lt;/SPAN&gt;), but I have to admit that I did not understand yet what the "result" is supposed to do, maybe that's my problem.&lt;/P&gt;&lt;P&gt;Thanks for looking into it!&lt;/P&gt;</description>
      <pubDate>Thu, 14 Nov 2024 17:58:03 GMT</pubDate>
      <guid>https://community.esri.com/t5/attribute-rules-questions/attribute-rules-on-update-field-quot-the-field/m-p/1558772#M1621</guid>
      <dc:creator>DrNicsi</dc:creator>
      <dc:date>2024-11-14T17:58:03Z</dc:date>
    </item>
    <item>
      <title>Re: Attribute rules on update field: "The field type is not supported by arcade script."</title>
      <link>https://community.esri.com/t5/attribute-rules-questions/attribute-rules-on-update-field-quot-the-field/m-p/1558888#M1622</link>
      <description>&lt;P&gt;I'm not an expert on attribute rules, but from the &lt;A href="https://pro.arcgis.com/en/pro-app/latest/help/data/geodatabases/overview/attribute-rule-dictionary-keywords.htm#ESRI_SECTION2_8FAC67C808DA4E8096373F40047BA08F" target="_self"&gt;documentation&lt;/A&gt;, it looks like you're missing the required object ID or global ID parameter in the updates object&lt;/P&gt;</description>
      <pubDate>Thu, 14 Nov 2024 20:41:52 GMT</pubDate>
      <guid>https://community.esri.com/t5/attribute-rules-questions/attribute-rules-on-update-field-quot-the-field/m-p/1558888#M1622</guid>
      <dc:creator>KenBuja</dc:creator>
      <dc:date>2024-11-14T20:41:52Z</dc:date>
    </item>
    <item>
      <title>Re: Attribute rules on update field: "The field type is not supported by arcade script."</title>
      <link>https://community.esri.com/t5/attribute-rules-questions/attribute-rules-on-update-field-quot-the-field/m-p/1558891#M1623</link>
      <description>&lt;P&gt;Update:&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="c"&gt;var select="upi='"+$feature["upi"] +"'";
var fs = FeatureSetbyName($datastore, "bpmis.sde.bpmis_data");
var parent=FeatureSetbyName($datastore, "bpmis.sde.bpmis_distinct",["globalid"],false);
var upi_filtered=Filter(fs,select);
var parent_filtered=Filter(parent,select);
for (var id in parent_filtered){
   var parentid=id.globalid;
}
var cnt=Count(upi_filtered)

if (cnt&amp;gt;0){
return {
    "edit": [
         {
          "className":"bpmis.sde.bpmis_distinct",
          "updates":[
              {
              "globalid":  parentid,
              "attributes": {
                  "permit_cnt": cnt
                  }
              }
            ]
         }  
       ]
}
}&lt;/LI-CODE&gt;&lt;P&gt;I am getting closer... At least I don't get an error message any longer but the number is always +1 to what it should be.&lt;/P&gt;</description>
      <pubDate>Thu, 14 Nov 2024 20:44:22 GMT</pubDate>
      <guid>https://community.esri.com/t5/attribute-rules-questions/attribute-rules-on-update-field-quot-the-field/m-p/1558891#M1623</guid>
      <dc:creator>DrNicsi</dc:creator>
      <dc:date>2024-11-14T20:44:22Z</dc:date>
    </item>
    <item>
      <title>Re: Attribute rules on update field: "The field type is not supported by arcade script."</title>
      <link>https://community.esri.com/t5/attribute-rules-questions/attribute-rules-on-update-field-quot-the-field/m-p/1559478#M1630</link>
      <description>&lt;P&gt;Only returning cnt in the popup still gives the correct value. No idea why it would return value+1 when updating the parent table &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 16 Nov 2024 17:20:02 GMT</pubDate>
      <guid>https://community.esri.com/t5/attribute-rules-questions/attribute-rules-on-update-field-quot-the-field/m-p/1559478#M1630</guid>
      <dc:creator>DrNicsi</dc:creator>
      <dc:date>2024-11-16T17:20:02Z</dc:date>
    </item>
  </channel>
</rss>

