<?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: Getting exifInfo with arcade in ArcGIS Online Questions</title>
    <link>https://community.esri.com/t5/arcgis-online-questions/getting-exifinfo-with-arcade/m-p/1557733#M62299</link>
    <description>&lt;P&gt;hi,&lt;/P&gt;&lt;P&gt;Finally I didn't end up using this solution but I found this in my old notes:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;var agol = portal("https://www.arcgis.com");
var layer = featuresetbyportalitem(agol, ITEM_ID, LAYER_ID_IN_SERVICE, ["*"], false);
var features = [];
for (var e in layer) {
  var att = attachments(e, {metadata: True})
    if (count(att) &amp;gt; 0)  {
      for (var a in att) {
        //here is where you loop in your exifInfo
        for (var i in att[a].exifInfo) {
          //here is where I believe you will be able to get the metadata
          //I don't remember what I was trying to check
          if (att[a].exifInfo[i].name == "Exif IFD0") {
            // "Exif SubIFD" // "GPS"
            push(features, att[a].exifInfo[i])
          }
        }
      }
    }
  }
}
return features&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Check out &lt;A href="https://developers.arcgis.com/rest/services-reference/enterprise/query-exif-info/" target="_self"&gt;this&lt;/A&gt; and &lt;A href="https://developers.arcgis.com/rest/services-reference/enterprise/query-attachments-feature-service-layer/" target="_self"&gt;this&lt;/A&gt;.&lt;/P&gt;&lt;P&gt;Hope this will help you and anybody else in the future!&lt;/P&gt;</description>
    <pubDate>Tue, 12 Nov 2024 20:10:18 GMT</pubDate>
    <dc:creator>mikaël</dc:creator>
    <dc:date>2024-11-12T20:10:18Z</dc:date>
    <item>
      <title>Getting exifInfo with arcade</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/getting-exifinfo-with-arcade/m-p/1354138#M56109</link>
      <description>&lt;P&gt;I wish to extract exif metadata (lat and long) from pictures taken and uploaded to a feature service on AGOL from a Survey123 form. I know I can do this directly in the XLSForm by using the pulldata("@exif") function, but I would prefer not adding more columns to my table (plus, the number of pictures that a user can take is multiple so I don't know how I would deal with the ensuing unknown multiple coordinates).&lt;/P&gt;&lt;P&gt;So I was thinking more of extracting the exif metadata with arcade (either in map viewer or dashboard), with attachments(value).exifInfo in a loop. I'm able to retrieve other metadata (name, id, contentType, and so on), but exifInfo seems to always be empty.&lt;/P&gt;&lt;P&gt;Searching a bit, I stumbled upon this &lt;A href="https://community.esri.com/t5/arcgis-survey123-questions/survey123-missing-exif-data-when-uploaded-from-ios/m-p/781892" target="_self"&gt;thread&lt;/A&gt; which is based on HEIC format pictures. I thought this could be my case too, because workers on the field use iPads. However, I just tried sending out a form with a picture taken on an Android device and I have the same problem.&lt;/P&gt;&lt;P&gt;When I download the pictures (either taken from Android or iPad/iOS) from AGOL to my computer, the location is indeed present in the metadata. So my guess is i'm not using the attachments() function correctly.&lt;/P&gt;&lt;P&gt;For other metadata I do:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;var features = [];
var att = attachments(e); //where e is $feature or is another var from a loop in a layer/table
if (count(att) &amp;gt; 0) {
    for (var a in att) {
        push(features, att[a].name) //works
        //push(features, att[a].exifInfo) &amp;gt;&amp;gt; always empty
        //also tried looping through att[a].exifInfo or manually att[a].exifInfo[0], att[a].exifInfo[1] and so on...
   }
return features;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any idea what i'm doing wrong?&lt;/P&gt;&lt;P&gt;Thanks for your help!&lt;/P&gt;</description>
      <pubDate>Tue, 28 Nov 2023 16:51:27 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/getting-exifinfo-with-arcade/m-p/1354138#M56109</guid>
      <dc:creator>mikaël</dc:creator>
      <dc:date>2023-11-28T16:51:27Z</dc:date>
    </item>
    <item>
      <title>Re: Getting exifInfo with arcade</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/getting-exifinfo-with-arcade/m-p/1355832#M56197</link>
      <description>&lt;P&gt;Ended up contacting support and they provided the answer I was looking for.&lt;/P&gt;&lt;P&gt;I had to use &lt;A href="https://developers.arcgis.com/arcade/function-reference/featureset_functions/#attachments:~:text=attachment%20in%20bytes.-,metadata,-(Optional)%3A" target="_self"&gt;parameter "metadata"&lt;/A&gt;:&amp;nbsp;&lt;EM&gt;"metadata (Optional): Boolean - Indicates whether to include attachment metadata in the function return. Only Exif metadata for images is currently supported"&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;var att = attachments(e, {metadata: True});&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Then I had to loop through a couple of dictionaries inside exifInfo but with trial and error I got the GPS coordinates.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Fri, 01 Dec 2023 18:22:56 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/getting-exifinfo-with-arcade/m-p/1355832#M56197</guid>
      <dc:creator>mikaël</dc:creator>
      <dc:date>2023-12-01T18:22:56Z</dc:date>
    </item>
    <item>
      <title>Re: Getting exifInfo with arcade</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/getting-exifinfo-with-arcade/m-p/1557587#M62293</link>
      <description>&lt;P&gt;hey! would you mind dropping the full code snippet that worked? I'm trying to do this as well (except I want to grab direction) but I'm always getting that empty return even with {metadata:true}. thanks!&lt;/P&gt;</description>
      <pubDate>Tue, 12 Nov 2024 16:03:19 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/getting-exifinfo-with-arcade/m-p/1557587#M62293</guid>
      <dc:creator>KatelynCline</dc:creator>
      <dc:date>2024-11-12T16:03:19Z</dc:date>
    </item>
    <item>
      <title>Re: Getting exifInfo with arcade</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/getting-exifinfo-with-arcade/m-p/1557733#M62299</link>
      <description>&lt;P&gt;hi,&lt;/P&gt;&lt;P&gt;Finally I didn't end up using this solution but I found this in my old notes:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;var agol = portal("https://www.arcgis.com");
var layer = featuresetbyportalitem(agol, ITEM_ID, LAYER_ID_IN_SERVICE, ["*"], false);
var features = [];
for (var e in layer) {
  var att = attachments(e, {metadata: True})
    if (count(att) &amp;gt; 0)  {
      for (var a in att) {
        //here is where you loop in your exifInfo
        for (var i in att[a].exifInfo) {
          //here is where I believe you will be able to get the metadata
          //I don't remember what I was trying to check
          if (att[a].exifInfo[i].name == "Exif IFD0") {
            // "Exif SubIFD" // "GPS"
            push(features, att[a].exifInfo[i])
          }
        }
      }
    }
  }
}
return features&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Check out &lt;A href="https://developers.arcgis.com/rest/services-reference/enterprise/query-exif-info/" target="_self"&gt;this&lt;/A&gt; and &lt;A href="https://developers.arcgis.com/rest/services-reference/enterprise/query-attachments-feature-service-layer/" target="_self"&gt;this&lt;/A&gt;.&lt;/P&gt;&lt;P&gt;Hope this will help you and anybody else in the future!&lt;/P&gt;</description>
      <pubDate>Tue, 12 Nov 2024 20:10:18 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/getting-exifinfo-with-arcade/m-p/1557733#M62299</guid>
      <dc:creator>mikaël</dc:creator>
      <dc:date>2024-11-12T20:10:18Z</dc:date>
    </item>
  </channel>
</rss>

