<?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: QML Javascript get Attachments in ArcGIS AppStudio Questions</title>
    <link>https://community.esri.com/t5/arcgis-appstudio-questions/qml-javascript-get-attachments/m-p/774509#M590</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Erwin thanks for getting back to me.  I think I figured what my issue was.  I wasn't letting the async finish before doing the count.  This is my code snippet that gets me the attachment info, it seems.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;                        feature.attachments.fetchAttachmentsStatusChanged.connect(function(){&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;                            if(feature.attachments.fetchAttachmentsStatus===Enums.TaskStatusCompleted){&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;                                console.log("the task has completed")&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;                                console.log(feature.attachments.count)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;                                var firstAttachment = feature.attachments.get(0)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;                                console.log(firstAttachment.name)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;                            }else if(feature.attachments.fetchAttachmentsStatus!==Enums.TaskStatusCompleted){&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;                            console.log("task has not completed")&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;                            }&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;                        })?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;James&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 18 May 2020 20:57:43 GMT</pubDate>
    <dc:creator>JamesWallace1</dc:creator>
    <dc:date>2020-05-18T20:57:43Z</dc:date>
    <item>
      <title>QML Javascript get Attachments</title>
      <link>https://community.esri.com/t5/arcgis-appstudio-questions/qml-javascript-get-attachments/m-p/774507#M588</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Erwin,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I recently took the zoom class in appStudio. I was able to figure out quite a bit from the documentation, but I'm having a hard time with getting attachment information from the feature qml object.&amp;nbsp; I'm trying to select a feature qml object from a featureLayer qml object and get the attachment info.&amp;nbsp; After the Selection, whenever I do feature.attachments.count&amp;nbsp; it returns 0 and I know that there are attachments.&amp;nbsp; I know I can return the geometry of the feature and attributes, but having a hard time with attachments. It doesn't seem like the attachments QML List is asynchronous or that I need to do a fetch of any kind. I looked at the edit Attachment example on GitHub but for some reason I can't seem to replicate the example.&amp;nbsp; I feel like it's something easy I'm missing.&amp;nbsp; Thanks for any assistance.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;James W.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 15 May 2020 04:06:58 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-appstudio-questions/qml-javascript-get-attachments/m-p/774507#M588</guid>
      <dc:creator>JamesWallace1</dc:creator>
      <dc:date>2020-05-15T04:06:58Z</dc:date>
    </item>
    <item>
      <title>Re: QML Javascript get Attachments</title>
      <link>https://community.esri.com/t5/arcgis-appstudio-questions/qml-javascript-get-attachments/m-p/774508#M589</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;James,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How did you get the attachment? Can you show us some code snippet?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Are you using this method from &lt;A href="https://community.esri.com/space/2136"&gt;ArcGIS Runtime SDK for Qt&lt;/A&gt;,&amp;nbsp;&lt;A class="link-titled" href="https://developers.arcgis.com/qt/latest/qml/api-reference/qml-esri-arcgisruntime-attachmentlistmodel.html" title="https://developers.arcgis.com/qt/latest/qml/api-reference/qml-esri-arcgisruntime-attachmentlistmodel.html"&gt;AttachmentListModel QML Type | ArcGIS for Developers&lt;/A&gt;&amp;nbsp;?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Remember this is an asynchronous call, so we&amp;nbsp;need check the status of the fetchAttachment operation, there is a chance that it is not completed yet,&amp;nbsp;&lt;A class="link-titled" href="https://developers.arcgis.com/qt/latest/qml/api-reference/qml-esri-arcgisruntime-attachmentlistmodel.html" title="https://developers.arcgis.com/qt/latest/qml/api-reference/qml-esri-arcgisruntime-attachmentlistmodel.html"&gt;AttachmentListModel QML Type | ArcGIS for Developers&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you,&lt;/P&gt;&lt;P&gt;Erwin&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 15 May 2020 20:27:44 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-appstudio-questions/qml-javascript-get-attachments/m-p/774508#M589</guid>
      <dc:creator>ErwinSoekianto</dc:creator>
      <dc:date>2020-05-15T20:27:44Z</dc:date>
    </item>
    <item>
      <title>Re: QML Javascript get Attachments</title>
      <link>https://community.esri.com/t5/arcgis-appstudio-questions/qml-javascript-get-attachments/m-p/774509#M590</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Erwin thanks for getting back to me.  I think I figured what my issue was.  I wasn't letting the async finish before doing the count.  This is my code snippet that gets me the attachment info, it seems.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;                        feature.attachments.fetchAttachmentsStatusChanged.connect(function(){&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;                            if(feature.attachments.fetchAttachmentsStatus===Enums.TaskStatusCompleted){&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;                                console.log("the task has completed")&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;                                console.log(feature.attachments.count)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;                                var firstAttachment = feature.attachments.get(0)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;                                console.log(firstAttachment.name)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;                            }else if(feature.attachments.fetchAttachmentsStatus!==Enums.TaskStatusCompleted){&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;                            console.log("task has not completed")&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;                            }&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;                        })?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;James&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 18 May 2020 20:57:43 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-appstudio-questions/qml-javascript-get-attachments/m-p/774509#M590</guid>
      <dc:creator>JamesWallace1</dc:creator>
      <dc:date>2020-05-18T20:57:43Z</dc:date>
    </item>
  </channel>
</rss>

