<?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: Choose Default/First Attachment in Attachment Viewer in ArcGIS Instant Apps Questions</title>
    <link>https://community.esri.com/t5/arcgis-instant-apps-questions/choose-default-first-attachment-in-attachment/m-p/1619924#M3219</link>
    <description>&lt;P class="lia-align-justify"&gt;Two potential solutions that come to mind (I haven't tested them, but they might be worth a try!)&lt;BR /&gt;&amp;nbsp;1. Open your feature layer with attachments in AGOL Map Viewer and configure the pop-ups.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="hkomm_0-1748828217510.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/133572i019D6752E7EE423E/image-size/medium?v=v2&amp;amp;px=400" role="button" title="hkomm_0-1748828217510.png" alt="hkomm_0-1748828217510.png" /&gt;&lt;/span&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;2. Use HTML/Arcade expressions within your pop-up to sort the attachments by file type.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;If you haven't come across this link, it could be helpful - &lt;A href="https://www.esri.com/arcgis-blog/products/arcgis-online/mapping/configure-pop-ups-basics#content" target="_self"&gt;Pop-ups Essentials&lt;/A&gt;&lt;/P&gt;</description>
    <pubDate>Mon, 02 Jun 2025 01:43:44 GMT</pubDate>
    <dc:creator>hkomm</dc:creator>
    <dc:date>2025-06-02T01:43:44Z</dc:date>
    <item>
      <title>Choose Default/First Attachment in Attachment Viewer</title>
      <link>https://community.esri.com/t5/arcgis-instant-apps-questions/choose-default-first-attachment-in-attachment/m-p/1611689#M3182</link>
      <description>&lt;P&gt;Does anyone know of a way to choose which attachment shows first in the Attachment Viewer Instant App? I can't find any settings to choose how to sort the attachments if there are multiple attachments in a feature. I'm wanting an image to show first instead of other documents such as PDFs that are attached. I'm assuming this could be done via the webmap also but can't find any way to sort the attachments in a feature there either.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 05 May 2025 16:16:36 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-instant-apps-questions/choose-default-first-attachment-in-attachment/m-p/1611689#M3182</guid>
      <dc:creator>ISP_graynic</dc:creator>
      <dc:date>2025-05-05T16:16:36Z</dc:date>
    </item>
    <item>
      <title>Re: Choose Default/First Attachment in Attachment Viewer</title>
      <link>https://community.esri.com/t5/arcgis-instant-apps-questions/choose-default-first-attachment-in-attachment/m-p/1619924#M3219</link>
      <description>&lt;P class="lia-align-justify"&gt;Two potential solutions that come to mind (I haven't tested them, but they might be worth a try!)&lt;BR /&gt;&amp;nbsp;1. Open your feature layer with attachments in AGOL Map Viewer and configure the pop-ups.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="hkomm_0-1748828217510.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/133572i019D6752E7EE423E/image-size/medium?v=v2&amp;amp;px=400" role="button" title="hkomm_0-1748828217510.png" alt="hkomm_0-1748828217510.png" /&gt;&lt;/span&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;2. Use HTML/Arcade expressions within your pop-up to sort the attachments by file type.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;If you haven't come across this link, it could be helpful - &lt;A href="https://www.esri.com/arcgis-blog/products/arcgis-online/mapping/configure-pop-ups-basics#content" target="_self"&gt;Pop-ups Essentials&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 02 Jun 2025 01:43:44 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-instant-apps-questions/choose-default-first-attachment-in-attachment/m-p/1619924#M3219</guid>
      <dc:creator>hkomm</dc:creator>
      <dc:date>2025-06-02T01:43:44Z</dc:date>
    </item>
    <item>
      <title>Re: Choose Default/First Attachment in Attachment Viewer</title>
      <link>https://community.esri.com/t5/arcgis-instant-apps-questions/choose-default-first-attachment-in-attachment/m-p/1643065#M3377</link>
      <description>&lt;P&gt;You can do this in the web map's popup using Arcade.&amp;nbsp;&lt;/P&gt;&lt;P&gt;1. Add an image to the popup (+ Add content)&lt;/P&gt;&lt;P&gt;2. Next to URL, choose the curly brackets { }&lt;/P&gt;&lt;P&gt;3. Click + Add expression at the bottom&lt;/P&gt;&lt;P&gt;4. Apply the script below&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;//This script will concatenate a URL to show the first attachment of a feature.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;//The First function will grab the ID for the first attachment of the feature&lt;BR /&gt;//part1 is the first part of the URL. You can find the URL by examining the attribute table and "View attachment"&lt;BR /&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;var&lt;/SPAN&gt; &lt;SPAN&gt;attachment&lt;/SPAN&gt;&lt;SPAN&gt; = &lt;/SPAN&gt;&lt;SPAN&gt;First&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;Attachments&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;$feature&lt;/SPAN&gt;&lt;SPAN&gt;)).&lt;/SPAN&gt;&lt;SPAN&gt;ID&lt;BR /&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;var&lt;/SPAN&gt; &lt;SPAN&gt;part1&lt;/SPAN&gt;&lt;SPAN&gt; = &lt;/SPAN&gt;&lt;SPAN&gt;"&amp;nbsp;&lt;A href="https://services.arcgis.com/[feature's" target="_blank"&gt;https://services.arcgis.com/[feature's&lt;/A&gt; unique ID]/arcgis/rest/services/[the feature layer's name]/FeatureServer/0/"&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN&gt;var&lt;/SPAN&gt; &lt;SPAN&gt;ObjectID&lt;/SPAN&gt;&lt;SPAN&gt; = &lt;/SPAN&gt;&lt;SPAN&gt;$feature&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;OBJECTID&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;var&lt;/SPAN&gt; &lt;SPAN&gt;part2&lt;/SPAN&gt;&lt;SPAN&gt; = &lt;/SPAN&gt;&lt;SPAN&gt;"/attachments/"&lt;/SPAN&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;SPAN&gt;//Return a concatenated string, the URL for the feature's first attachment&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;return&lt;/SPAN&gt; &lt;SPAN&gt;part1&lt;/SPAN&gt;&lt;SPAN&gt; + &lt;/SPAN&gt;&lt;SPAN&gt;ObjectID&lt;/SPAN&gt;&lt;SPAN&gt; + &lt;/SPAN&gt;&lt;SPAN&gt;part2&lt;/SPAN&gt;&lt;SPAN&gt; + &lt;/SPAN&gt;&lt;SPAN&gt;attachment&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 18 Aug 2025 22:56:27 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-instant-apps-questions/choose-default-first-attachment-in-attachment/m-p/1643065#M3377</guid>
      <dc:creator>KateBCarlson</dc:creator>
      <dc:date>2025-08-18T22:56:27Z</dc:date>
    </item>
  </channel>
</rss>

