<?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 for enforcing attachments? in ArcGIS Pro Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-questions/attribute-rules-for-enforcing-attachments/m-p/164071#M7419</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Right on.&amp;nbsp; Now it seems that will enforce the attachment type, but it won't enforce that a point must have an attachment, right?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 28 Jan 2020 13:17:53 GMT</pubDate>
    <dc:creator>AndrewZimba1</dc:creator>
    <dc:date>2020-01-28T13:17:53Z</dc:date>
    <item>
      <title>Attribute rules for enforcing attachments?</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/attribute-rules-for-enforcing-attachments/m-p/164069#M7417</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;When building services for Collector with feature classes in an enterprise gdb, are attribute rules the appropriate mechanism for enforcing the inclusion of a .jpg attachment to a point and returning an error message if a save attempt is made without such an attachment?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 27 Jan 2020 12:27:07 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/attribute-rules-for-enforcing-attachments/m-p/164069#M7417</guid>
      <dc:creator>AndrewZimba1</dc:creator>
      <dc:date>2020-01-27T12:27:07Z</dc:date>
    </item>
    <item>
      <title>Re: Attribute rules for enforcing attachments?</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/attribute-rules-for-enforcing-attachments/m-p/164070#M7418</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Attribute rule is one way to enforce this. You should be able to add a constraint rule to the attachments table of your class that prevents adding a row to the attachment table if the extension is not jpg. You could then publish the class as a feature service to ArcGIS Enterprise and consume it from collector. (Attribute rules not supported on ArcGIS Online yet)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is an example&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG class="image-1 jive-image" src="https://community.esri.com/legacyfs/online/479494_pastedImage_1.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is an example script&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="comment token"&gt;//if the extension is jpg allow the edit, else don't allow the edit. &lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;if&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;right&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;$feature&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;ATT_NAME&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;3&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;==&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"jpg"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;return&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;true&lt;/SPAN&gt;

&lt;SPAN class="keyword token"&gt;return&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;false&lt;/SPAN&gt;&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The attachment will only be added if the file has a `jpg` extension. There might be a bug where you won't get a meaningful error message back today. We might be able to get to that in the future where the actual error message comes back. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 08:35:44 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/attribute-rules-for-enforcing-attachments/m-p/164070#M7418</guid>
      <dc:creator>HusseinNasser2</dc:creator>
      <dc:date>2021-12-11T08:35:44Z</dc:date>
    </item>
    <item>
      <title>Re: Attribute rules for enforcing attachments?</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/attribute-rules-for-enforcing-attachments/m-p/164071#M7419</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Right on.&amp;nbsp; Now it seems that will enforce the attachment type, but it won't enforce that a point must have an attachment, right?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Jan 2020 13:17:53 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/attribute-rules-for-enforcing-attachments/m-p/164071#M7419</guid>
      <dc:creator>AndrewZimba1</dc:creator>
      <dc:date>2020-01-28T13:17:53Z</dc:date>
    </item>
    <item>
      <title>Re: Attribute rules for enforcing attachments?</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/attribute-rules-for-enforcing-attachments/m-p/164072#M7420</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&amp;nbsp;&lt;A href="https://community.esri.com/migrated-users/234590"&gt;Andrew Zimba&lt;/A&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Arcade provides the &lt;A href="https://developers.arcgis.com/arcade/function-reference/data_functions/#attachments"&gt;Attachments function&lt;/A&gt; which will return an array of the &lt;A href="https://developers.arcgis.com/arcade/guide/types/#attachment"&gt;Attachment types&lt;/A&gt;. The problem is that these functions and types are not available in the Attribute rule profile (yet?). Normally you would do a Count and if the count is larger than 0, you could check the content type.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There might be a way using a FeatureSetBy* in combination with Filter to get to the result, but it would be better to have the Attachments function and Attachment type available in the attribute rule profiles.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.esri.com/people/HNasser-esristaff"&gt;HNasser-esristaff&lt;/A&gt;&amp;nbsp;; any idea if that is on the roadmap?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Jan 2020 14:46:12 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/attribute-rules-for-enforcing-attachments/m-p/164072#M7420</guid>
      <dc:creator>XanderBakker</dc:creator>
      <dc:date>2020-01-28T14:46:12Z</dc:date>
    </item>
    <item>
      <title>Re: Attribute rules for enforcing attachments?</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/attribute-rules-for-enforcing-attachments/m-p/164073#M7421</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;There is an example attribute rule (constraint) here by&amp;nbsp;&lt;A href="https://community.esri.com/people/mmiller-esristaff"&gt;mmiller-esristaff&lt;/A&gt;&amp;nbsp;that could help get started:&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="https://github.com/MikeMillerGIS/arcade-expressions/blob/master/attribute_rule_constraint/reject_too_many_related.md" title="https://github.com/MikeMillerGIS/arcade-expressions/blob/master/attribute_rule_constraint/reject_too_many_related.md"&gt;arcade-expressions/reject_too_many_related.md at master · MikeMillerGIS/arcade-expressions · GitHub&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Jan 2020 14:54:07 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/attribute-rules-for-enforcing-attachments/m-p/164073#M7421</guid>
      <dc:creator>XanderBakker</dc:creator>
      <dc:date>2020-01-28T14:54:07Z</dc:date>
    </item>
    <item>
      <title>Re: Attribute rules for enforcing attachments?</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/attribute-rules-for-enforcing-attachments/m-p/164074#M7422</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'll check it out.&amp;nbsp; Thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Jan 2020 15:49:15 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/attribute-rules-for-enforcing-attachments/m-p/164074#M7422</guid>
      <dc:creator>AndrewZimba1</dc:creator>
      <dc:date>2020-01-28T15:49:15Z</dc:date>
    </item>
    <item>
      <title>Re: Attribute rules for enforcing attachments?</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/attribute-rules-for-enforcing-attachments/m-p/164075#M7423</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Xander!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The Attachments arcade function is actually supported on the Attribute Rules profile, we will just need to update the documentation to reflect that. Good find! So yes one can prevent a feature from being created/updated if no attachments was found. However I see this rule fits more as Validation rule instead of a constraint rule (Generating errors for existing features with no attachments)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG class="image-1 jive-image" src="https://community.esri.com/legacyfs/online/479649_pastedImage_1.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG class="image-2 jive-image" src="https://community.esri.com/legacyfs/online/479650_pastedImage_2.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Jan 2020 16:49:33 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/attribute-rules-for-enforcing-attachments/m-p/164075#M7423</guid>
      <dc:creator>HusseinNasser2</dc:creator>
      <dc:date>2020-01-28T16:49:33Z</dc:date>
    </item>
    <item>
      <title>Re: Attribute rules for enforcing attachments?</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/attribute-rules-for-enforcing-attachments/m-p/164076#M7424</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Something here I'm not getting.&amp;nbsp; I'm attempting to implement as a Validation rule.&amp;nbsp; Here's the rule setup:&lt;/P&gt;&lt;P&gt;&lt;IMG class="image-1 jive-image" src="https://community.esri.com/legacyfs/online/479685_pastedImage_1.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;On save it throws Error 001946: The input workspace type must be branch version.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Not sure what is going on here.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Jan 2020 19:16:03 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/attribute-rules-for-enforcing-attachments/m-p/164076#M7424</guid>
      <dc:creator>AndrewZimba1</dc:creator>
      <dc:date>2020-01-28T19:16:03Z</dc:date>
    </item>
    <item>
      <title>Re: Attribute rules for enforcing attachments?</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/attribute-rules-for-enforcing-attachments/m-p/164077#M7425</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&amp;nbsp;&lt;A href="https://community.esri.com/migrated-users/234590" target="_blank"&gt;Andrew Zimba&lt;/A&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Not sure if branch versioning is required to implement this type of attribute rule.&amp;nbsp;&lt;A href="https://community.esri.com/migrated-users/154383" target="_blank"&gt;Hussein Nasser&lt;/A&gt;&amp;nbsp;; can you confirm?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What you do need to know is that you should check using "count" and not comparing it to null. If you do not have attachments,&amp;nbsp;it will return an array with no items, yet it will not be null.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Since you want to check for jpg attachments, see the example below that will only check this content type and in this example I also check for the images size between 1M and 5M bytes.&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="keyword token"&gt;var&lt;/SPAN&gt; options &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"types"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"image/jpeg"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;
               &lt;SPAN class="string token"&gt;"minsize"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;1000000&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;
               &lt;SPAN class="string token"&gt;"maxsize"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;5000000&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;var&lt;/SPAN&gt; atts &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="token function"&gt;Attachments&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;$feature&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; options&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;if&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;Count&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;atts&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;==&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;0&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
    &lt;SPAN class="keyword token"&gt;return&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;false&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;else&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
    &lt;SPAN class="keyword token"&gt;return&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;true&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;
&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 08:35:47 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/attribute-rules-for-enforcing-attachments/m-p/164077#M7425</guid>
      <dc:creator>XanderBakker</dc:creator>
      <dc:date>2021-12-11T08:35:47Z</dc:date>
    </item>
    <item>
      <title>Re: Attribute rules for enforcing attachments?</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/attribute-rules-for-enforcing-attachments/m-p/164078#M7426</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Apologies I should have mentioned that and Thanks &lt;A href="https://community.esri.com/migrated-users/3100"&gt;Xander Bakker&lt;/A&gt;‌ for reminding me. Yes Validation and Batch Calculation rule are only supported Enterprise Geodatabase Datasets registered with branched versioned. We are bringing the support of File Geodatabase to these type of rules in the upcoming releases soon. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 30 Jan 2020 15:58:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/attribute-rules-for-enforcing-attachments/m-p/164078#M7426</guid>
      <dc:creator>HusseinNasser2</dc:creator>
      <dc:date>2020-01-30T15:58:06Z</dc:date>
    </item>
    <item>
      <title>Re: Attribute rules for enforcing attachments?</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/attribute-rules-for-enforcing-attachments/m-p/164079#M7427</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks&amp;nbsp;&lt;A href="https://community.esri.com/migrated-users/154383"&gt;Hussein Nasser&lt;/A&gt;&amp;nbsp;for clarifying this. I was aware of the requirement of the EGDB but not of the part that branch versioning was required. Good to know!&lt;/P&gt;&lt;P&gt;Will you be at the distributor UN workshop next week in Redlands? If so, see you there.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 30 Jan 2020 16:17:08 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/attribute-rules-for-enforcing-attachments/m-p/164079#M7427</guid>
      <dc:creator>XanderBakker</dc:creator>
      <dc:date>2020-01-30T16:17:08Z</dc:date>
    </item>
    <item>
      <title>Re: Attribute rules for enforcing attachments?</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/attribute-rules-for-enforcing-attachments/m-p/164080#M7428</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;One more question about attribute rules in general - will they work in collector when using it in offline mode?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 30 Jan 2020 16:22:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/attribute-rules-for-enforcing-attachments/m-p/164080#M7428</guid>
      <dc:creator>AndrewZimba1</dc:creator>
      <dc:date>2020-01-30T16:22:06Z</dc:date>
    </item>
    <item>
      <title>Re: Attribute rules for enforcing attachments?</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/attribute-rules-for-enforcing-attachments/m-p/164081#M7429</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;No they will not work in Collector in offline mode, that is because when we download the data offline the Attribute Rules are not coming back with the data. They will only work on online mode and will be triggered on the server side. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the future releases we will have the capability for Collector and other ArcGIS Runtime applications to download Attribute Rules and execute them locally offline. It is a big project that is in the works&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 30 Jan 2020 18:18:11 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/attribute-rules-for-enforcing-attachments/m-p/164081#M7429</guid>
      <dc:creator>HusseinNasser2</dc:creator>
      <dc:date>2020-01-30T18:18:11Z</dc:date>
    </item>
    <item>
      <title>Re: Attribute rules for enforcing attachments?</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/attribute-rules-for-enforcing-attachments/m-p/1368284#M77187</link>
      <description>&lt;P&gt;Hi &lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/346994"&gt;@HusseinNasser2&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am using the code that was shared here but I got an unexpected error:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="geopamplona_0-1704887592819.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/91050iC20DCC068C1732B0/image-size/medium?v=v2&amp;amp;px=400" role="button" title="geopamplona_0-1704887592819.png" alt="geopamplona_0-1704887592819.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I get the following error&lt;BR /&gt;invalid arcade expression, arcade error: expected attachment type, script line: 4&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My attribute rule:&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;P&gt;var features = FeatureSetByName($datastore,'SewerLine', ['*'], false);&lt;BR /&gt;var gid=$feature.REL_GLOBALID;&lt;BR /&gt;var item=First(Filter(features, 'globalid = @gid'));&lt;BR /&gt;var count = Count(Attachments(item));&lt;BR /&gt;if ($editcontext.editType == 'DELETE'){&lt;BR /&gt;var count_total=count-1&lt;BR /&gt;} else {&lt;BR /&gt;var count_total=count&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;return {&lt;BR /&gt;'edit': [{&lt;BR /&gt;'classname' : 'SewerLine',&lt;BR /&gt;'updates' : [{&lt;BR /&gt;'globalid': gid,&lt;BR /&gt;'attributes' : {'NumAdjuntos' :count_total }&lt;BR /&gt;}]&lt;BR /&gt;}]&lt;BR /&gt;}&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;I have tried the same Count(Attachments()) line and it is valid arcade for calculated fields.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm using ArCGIS pro 2.9.11 and enterprise 2.9.1&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Wed, 10 Jan 2024 11:54:28 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/attribute-rules-for-enforcing-attachments/m-p/1368284#M77187</guid>
      <dc:creator>geopamplona</dc:creator>
      <dc:date>2024-01-10T11:54:28Z</dc:date>
    </item>
  </channel>
</rss>

