<?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 returned value but no field was specified - help in Attribute Rules Questions</title>
    <link>https://community.esri.com/t5/attribute-rules-questions/attribute-rule-returned-value-but-no-field-was/m-p/1595704#M1706</link>
    <description>&lt;P&gt;Hello, this is my first post so apologies for possible incorrect formatting or post location.&lt;/P&gt;&lt;P&gt;Very new to arcade and coding in general. I am trying to implement an attribute rule into my inspection table that triggers when an inspection is updated or created. Once this attribute rule is triggered it should populate a field in my permits layer stating the job has been completed. But&amp;nbsp; only if there is a final inspection type detected within the same permit ID (link field/ permit number).&amp;nbsp;&lt;/P&gt;&lt;P&gt;Attribute rule triggers are insert &amp;amp; update.&amp;nbsp; Exclude from application evaluation is checked. My errors and code are below. Thank you!&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="KallieH_1-1741977058714.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/127965i236CFE52241B8665/image-size/medium?v=v2&amp;amp;px=400" role="button" title="KallieH_1-1741977058714.png" alt="KallieH_1-1741977058714.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="KallieH_0-1741977027830.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/127964iC5943A0AAAD78F47/image-size/medium?v=v2&amp;amp;px=400" role="button" title="KallieH_0-1741977027830.png" alt="KallieH_0-1741977027830.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;// Get the harvest permit records
var relatedPermits = FeatureSetByName($datastore, "HarvestPermits_ExportFeatures", ["JOB_COMPLETED", "LINK_FIELD", "GLOBALID"], false);

// Get permit number from the record in the table
var permitNumber = $feature.PERMITNUMBER;

// Ensure permit IDs match
var relatedPermit = First(Filter(relatedPermits, "LINK_FIELD = @permitNumber"));

// Check if the current inspection is "final" and a related permit exists
if (Lower($feature.FIELD_INSPECTIONS_TYPE) == 'f' &amp;amp;&amp;amp; relatedPermit != null) {
    // Get the globalID of the related permit
    var permitGlobalID = relatedPermit.GLOBALID;

    // Update the harvest permits
    return {
        "edit": [{
            "className": "HarvestPermits_ExportFeatures",
            "updates": {
               "globalID": permitGlobalID,
               "attributes": {
                "JOB_COMPLETED": "Yes"
               }
            }

        }]
    };
} else {
    Console("Conditions not met for update. Inspection Type: " + $feature.FIELD_INSPECTIONS_TYPE);
}

// If no update was made, return null
return null;

&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 14 Mar 2025 18:35:14 GMT</pubDate>
    <dc:creator>KallieH</dc:creator>
    <dc:date>2025-03-14T18:35:14Z</dc:date>
    <item>
      <title>Attribute rule returned value but no field was specified - help</title>
      <link>https://community.esri.com/t5/attribute-rules-questions/attribute-rule-returned-value-but-no-field-was/m-p/1595704#M1706</link>
      <description>&lt;P&gt;Hello, this is my first post so apologies for possible incorrect formatting or post location.&lt;/P&gt;&lt;P&gt;Very new to arcade and coding in general. I am trying to implement an attribute rule into my inspection table that triggers when an inspection is updated or created. Once this attribute rule is triggered it should populate a field in my permits layer stating the job has been completed. But&amp;nbsp; only if there is a final inspection type detected within the same permit ID (link field/ permit number).&amp;nbsp;&lt;/P&gt;&lt;P&gt;Attribute rule triggers are insert &amp;amp; update.&amp;nbsp; Exclude from application evaluation is checked. My errors and code are below. Thank you!&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="KallieH_1-1741977058714.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/127965i236CFE52241B8665/image-size/medium?v=v2&amp;amp;px=400" role="button" title="KallieH_1-1741977058714.png" alt="KallieH_1-1741977058714.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="KallieH_0-1741977027830.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/127964iC5943A0AAAD78F47/image-size/medium?v=v2&amp;amp;px=400" role="button" title="KallieH_0-1741977027830.png" alt="KallieH_0-1741977027830.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;// Get the harvest permit records
var relatedPermits = FeatureSetByName($datastore, "HarvestPermits_ExportFeatures", ["JOB_COMPLETED", "LINK_FIELD", "GLOBALID"], false);

// Get permit number from the record in the table
var permitNumber = $feature.PERMITNUMBER;

// Ensure permit IDs match
var relatedPermit = First(Filter(relatedPermits, "LINK_FIELD = @permitNumber"));

// Check if the current inspection is "final" and a related permit exists
if (Lower($feature.FIELD_INSPECTIONS_TYPE) == 'f' &amp;amp;&amp;amp; relatedPermit != null) {
    // Get the globalID of the related permit
    var permitGlobalID = relatedPermit.GLOBALID;

    // Update the harvest permits
    return {
        "edit": [{
            "className": "HarvestPermits_ExportFeatures",
            "updates": {
               "globalID": permitGlobalID,
               "attributes": {
                "JOB_COMPLETED": "Yes"
               }
            }

        }]
    };
} else {
    Console("Conditions not met for update. Inspection Type: " + $feature.FIELD_INSPECTIONS_TYPE);
}

// If no update was made, return null
return null;

&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 14 Mar 2025 18:35:14 GMT</pubDate>
      <guid>https://community.esri.com/t5/attribute-rules-questions/attribute-rule-returned-value-but-no-field-was/m-p/1595704#M1706</guid>
      <dc:creator>KallieH</dc:creator>
      <dc:date>2025-03-14T18:35:14Z</dc:date>
    </item>
    <item>
      <title>Re: Attribute rule returned value but no field was specified - help</title>
      <link>https://community.esri.com/t5/attribute-rules-questions/attribute-rule-returned-value-but-no-field-was/m-p/1595803#M1707</link>
      <description>Change return null to just return&lt;BR /&gt;&lt;BR /&gt;Returning null means you are trying to set the assigned field to null.&lt;BR /&gt;</description>
      <pubDate>Sat, 15 Mar 2025 12:29:13 GMT</pubDate>
      <guid>https://community.esri.com/t5/attribute-rules-questions/attribute-rule-returned-value-but-no-field-was/m-p/1595803#M1707</guid>
      <dc:creator>MikeMillerGIS</dc:creator>
      <dc:date>2025-03-15T12:29:13Z</dc:date>
    </item>
  </channel>
</rss>

