<?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: Accessing attachments of an object using a custom widget in ArcGIS Experience Builder Questions</title>
    <link>https://community.esri.com/t5/arcgis-experience-builder-questions/accessing-attachments-of-an-object-using-a-custom/m-p/1410843#M12126</link>
    <description>&lt;P&gt;You won't be able to use arcpy because Experience Builder is written in Javascript, not Python. But it does have access to the Javascript API. You should be able to access the attachments through the queryAttachments() method of the featureLayer.&lt;/P&gt;&lt;P&gt;&lt;A href="https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#queryAttachments" target="_blank"&gt;https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#queryAttachments&lt;/A&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 17 Apr 2024 12:34:21 GMT</pubDate>
    <dc:creator>JeffreyThompson2</dc:creator>
    <dc:date>2024-04-17T12:34:21Z</dc:date>
    <item>
      <title>Accessing attachments of an object using a custom widget</title>
      <link>https://community.esri.com/t5/arcgis-experience-builder-questions/accessing-attachments-of-an-object-using-a-custom/m-p/1410790#M12125</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I'm looking to build a custom widget where the user will select a feature layer (in this case points collected on site).&lt;/P&gt;&lt;P&gt;From this I want to make a table which will show the OID&amp;nbsp; of the point, other field values but most importantly, a sum of the attachments at that point.&lt;/P&gt;&lt;P&gt;How can this be done through the custom widgets? Currently able to access this information through arcpy using&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;for feature in features:
    oid = feature.attributes['OBJECTID']

    attachments_info = layer.attachments.get_list(oid=oid)

    if attachments_info:
        for attachment_info in attachments_info:
            att_id = attachment_info['id']
            filename = attachment_info['name']
            attachment_list.append({'OID': oid, 'AttachmentID': att_id, 'Filename': filename})

attachment_df = pd.DataFrame(attachment_list)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is returning a dataframe with the OIDs and their attachments. I would like to achieve something similar in a custom widget.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Wed, 17 Apr 2024 08:45:47 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-experience-builder-questions/accessing-attachments-of-an-object-using-a-custom/m-p/1410790#M12125</guid>
      <dc:creator>HarryBonshor-Mayes</dc:creator>
      <dc:date>2024-04-17T08:45:47Z</dc:date>
    </item>
    <item>
      <title>Re: Accessing attachments of an object using a custom widget</title>
      <link>https://community.esri.com/t5/arcgis-experience-builder-questions/accessing-attachments-of-an-object-using-a-custom/m-p/1410843#M12126</link>
      <description>&lt;P&gt;You won't be able to use arcpy because Experience Builder is written in Javascript, not Python. But it does have access to the Javascript API. You should be able to access the attachments through the queryAttachments() method of the featureLayer.&lt;/P&gt;&lt;P&gt;&lt;A href="https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#queryAttachments" target="_blank"&gt;https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#queryAttachments&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 17 Apr 2024 12:34:21 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-experience-builder-questions/accessing-attachments-of-an-object-using-a-custom/m-p/1410843#M12126</guid>
      <dc:creator>JeffreyThompson2</dc:creator>
      <dc:date>2024-04-17T12:34:21Z</dc:date>
    </item>
  </channel>
</rss>

