<?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: Append with Attachments in ArcGIS Survey123 Questions</title>
    <link>https://community.esri.com/t5/arcgis-survey123-questions/append-with-attachments/m-p/1345415#M52665</link>
    <description>&lt;P&gt;Thanks Raul&lt;/P&gt;</description>
    <pubDate>Fri, 03 Nov 2023 03:59:35 GMT</pubDate>
    <dc:creator>MicZatorsky_AEC</dc:creator>
    <dc:date>2023-11-03T03:59:35Z</dc:date>
    <item>
      <title>Append with Attachments</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/append-with-attachments/m-p/1339878#M52434</link>
      <description>&lt;P&gt;Hi all.&lt;/P&gt;&lt;P&gt;What is the &lt;STRONG&gt;recommended workflow&lt;/STRONG&gt; to append records with photo attachments to an empty survey such that the attachments know which field they belong to?&lt;/P&gt;&lt;P&gt;The Append tool in Pro successfully inserts the records and maintains attachments into the hosted feature layer, but &lt;EM&gt;Feature Reports&lt;/EM&gt; do not show the photos.&amp;nbsp; I understand this has something to do with &lt;EM&gt;attachment keywords?&amp;nbsp;&lt;/EM&gt;&amp;nbsp; I have from 1 to 4 photos for each record, each belonging to one of four individual photo fields (photo1, photo2, photo3, photo4)&lt;/P&gt;&lt;P&gt;I'm using&lt;STRONG&gt; ArcGIS Online&lt;/STRONG&gt; and &lt;STRONG&gt;ArcGIS Pro 3.1.3&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Fri, 20 Oct 2023 01:02:38 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/append-with-attachments/m-p/1339878#M52434</guid>
      <dc:creator>MicZatorsky_AEC</dc:creator>
      <dc:date>2023-10-20T01:02:38Z</dc:date>
    </item>
    <item>
      <title>Re: Append with Attachments</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/append-with-attachments/m-p/1340008#M52444</link>
      <description>&lt;P&gt;The key to getting the Survey123 report to recognize an uploaded image to a specific (survey123) image field, is for the uploaded image to have the name of the image field on the 'Keywords' property of the attachment.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Capture.PNG" style="width: 449px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/83588iD30A37B0B785EBBC/image-size/large?v=v2&amp;amp;px=999" role="button" title="Capture.PNG" alt="Capture.PNG" /&gt;&lt;/span&gt;&lt;BR /&gt;I don't think there's currently any way to specify this property either through ArcGIS pro, nor the built in add attachment functionality on AGOL/ Portal for ArcGIS.&lt;BR /&gt;&lt;BR /&gt;However, you CAN specify this parameter either in the ArcGIS Rest API:&lt;BR /&gt;&lt;A href="https://developers.arcgis.com/rest/services-reference/enterprise/add-attachment.htm" target="_blank"&gt;https://developers.arcgis.com/rest/services-reference/enterprise/add-attachment.htm&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;Or using the ArcGIS API for Python - AttachmentManager.add()&lt;BR /&gt;&lt;A href="https://developers.arcgis.com/python/api-reference/arcgis.features.managers.html#attachmentmanager" target="_blank"&gt;https://developers.arcgis.com/python/api-reference/arcgis.features.managers.html#attachmentmanager&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;I've included a very simple python script as a sample of how it may be used.&lt;/P&gt;&lt;LI-CODE lang="python"&gt;from arcgis.gis import GIS
from arcgis.features import FeatureLayer
from arcgis.features.managers import AttachmentManager

def main():
    # Portal configuration
    portal_url = "https://www.arcgis.com"
    username = 'your_username'
    passw = 'your_password'

    # REST endpoint of service where to add image
    rest_url = 'https://services1.arcgis.com/.../ArcGIS/rest/services/.../FeatureServer/0'

    # Name of image field in SURVEY where image uploaded should be associated to
    img_field_name = 'photos_1'

    # Path to photo to be uploaded
    img_path = r'D:\Pictures\Stock\DVC6xnOAzZg.jpg'

    # Object Id of feature to attach image to
    oid_feature = 2

    # Create a GIS instance
    print('Attempting to login to ArcGIS [...]')
    gis = GIS(portal_url, username, passw)

    # Upload photo
    try:
        print('Uploading image [...]')
        fl = FeatureLayer(rest_url, gis)

        attachments_mgr = AttachmentManager(fl)
        res = attachments_mgr.add(oid_feature, img_path, keywords=img_field_name)
        if(res and res['addAttachmentResult'] and res['addAttachmentResult']['success']):
            print('Image uploaded Successfully!')

    except Exception as e:
        print('An error has occurred while attempting to upload the specified phhoto')
        print(repr(e))

if __name__ == "__main__":
    main()&lt;/LI-CODE&gt;</description>
      <pubDate>Fri, 20 Oct 2023 14:07:25 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/append-with-attachments/m-p/1340008#M52444</guid>
      <dc:creator>Raul</dc:creator>
      <dc:date>2023-10-20T14:07:25Z</dc:date>
    </item>
    <item>
      <title>Re: Append with Attachments</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/append-with-attachments/m-p/1345415#M52665</link>
      <description>&lt;P&gt;Thanks Raul&lt;/P&gt;</description>
      <pubDate>Fri, 03 Nov 2023 03:59:35 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/append-with-attachments/m-p/1345415#M52665</guid>
      <dc:creator>MicZatorsky_AEC</dc:creator>
      <dc:date>2023-11-03T03:59:35Z</dc:date>
    </item>
  </channel>
</rss>

