Select to view content in your preferred language

Attachments in web map not showing thumbnails

1869
7
Jump to solution
08-23-2023 07:54 AM
JulianMcCoy
Occasional Contributor

Hi,

I have ArcGIS for Portal and am trying to make a field service map that will have data appended to it regularly as field service is done. Prior to each update, I need to separate out some points and only append a few of them. This data has attachments that I want to be visible in the form of thumbnails in the popups.

To try this out, I made my map. I opened the field service report in ArcGIS Pro, selected the data I wanted, clicked layer from selection. Exported that selection to a feature class and then told it to append that to my hosted feature layer in my portal, keeping attachments.

It did that, but now the attachment thumbnails aren't showing up. What am I doing wrong? Below is how it looks like with the data I appended vs how it looks like on the target layer. 

JulianMcCoy_0-1692802269413.pngJulianMcCoy_1-1692802337043.png

 

 

1 Solution

Accepted Solutions
JulianMcCoy
Occasional Contributor

Davin,

We were running into BUG-000157511, which a very helpful ESRI customer support worker named Sanggithash told me after I'd gone through three or four support workers who had no idea what I was talking about, lol. The way she explained it, when we ran the append, the bug switched the data type from an image to a string. 

When she linked me to the bug, it was an issue on the version of ArcGIS Pro I was using (3.1). Downgrading to 3.0 fixed the issue to me. Now, allegedly, according to the bug reports, it has been fixed on the most recent version of ArcGIS Pro. So if you updated ArcGISPro since you first tried, that'd be why you can't reproduce the error. Which is good to hear that that's confirmed, because I haven't updated since (I have to call the IT guy to download and install any software updates and honestly just didn't want to go through the hassle of calling him to install the update, testing, and then calling him to downgrade it again if it turned out it wasn't actually fixed).

View solution in original post

7 Replies
DavinShokes1
Frequent Contributor

Any luck with this? I am also finding that appended features with attachments show no picture in the popup. The attachment must be downloaded before viewing as there is no thumbnail.

Seems like an issue with the append in Pro as adding the same image in Field Maps and Map Viewer produces a thumbnail. 

DavinShokes1_1-1696947213272.png

 

0 Kudos
DavinShokes1
Frequent Contributor

Mine appeared to be a bug during append that I couldn't reproduce. Reran the append and the new features have thumbnails on their attachments. 

0 Kudos
JulianMcCoy
Occasional Contributor

Davin,

We were running into BUG-000157511, which a very helpful ESRI customer support worker named Sanggithash told me after I'd gone through three or four support workers who had no idea what I was talking about, lol. The way she explained it, when we ran the append, the bug switched the data type from an image to a string. 

When she linked me to the bug, it was an issue on the version of ArcGIS Pro I was using (3.1). Downgrading to 3.0 fixed the issue to me. Now, allegedly, according to the bug reports, it has been fixed on the most recent version of ArcGIS Pro. So if you updated ArcGISPro since you first tried, that'd be why you can't reproduce the error. Which is good to hear that that's confirmed, because I haven't updated since (I have to call the IT guy to download and install any software updates and honestly just didn't want to go through the hassle of calling him to install the update, testing, and then calling him to downgrade it again if it turned out it wasn't actually fixed).

KevinOKeeffe
Emerging Contributor

Hi @JulianMcCoy , thank you very much for posting this article and the answer as I was tearing my hair out trying to solve this problem as I thought it was to do with the append or the add attachments tool corrupting the photos during the operation of the tool.
I was unable to downgrade to version 3.0. so upgraded to version 3.2 and thankfully the bug is fixed in that version also. It just seems to be isolated to version 3.1.

0 Kudos
JulianMcCoy
Occasional Contributor

Glad I could help. It was driving me crazy too. I was convinced it was something I was doing wrong. (And good to hear it is actually fixed on 3.2)

ChelseaRozek
MVP Regular Contributor

Anyone know of a way to fix these attachments without having to reappend? We've since edited the dataset so we can't just truncate those records and reappend.

I figured it out using the Python API:

thehostedlayer = gis.content.get('ITEMID')
mylyr = thehostedlayer.layers[0]
fixoids = [1062,1063,1065] #made a list of the 100s of objectids of features that needed fixing
for oid1 in fixoids:
    attachment_IDs = [a["id"] for a in mylyr.attachments.get_list(oid1)]
    for attachment1 in attachment_IDs: #goes through each attachment, so it's fine if the feature has more than one
        filepath = mylyr.attachments.download(oid1,attachment1,r"C:\Users\myname\Desktop\temp")
        mylyr.attachments.update(oid1,attachment1,r'%s'%filepath[0])

If you use mylyr.attachments.get_list(objectid), you can see before you run the script, my attachment type for photos were 'application/octet-stream'. after the script, they became 'image/jpeg' and finally displayed properly in the popups in my webmaps. There was a delay, though, even with clearing my cache. I left my PC for about an hour and when I came back the popups were fixed.

KevinOKeeffe
Emerging Contributor

Hi  @ChelseaRozek 

I though upgrading to version 3.2. of Pro would fix the bug 000157511 of attaching photos to an online layer which it does 95% of the time. For that 5% it’s the same issue, I though it was again something I was doing wrong in Pro but your script which is excellent shows that is Pro still isn’t 100%.

Thanks for sharing this valuable script it saving me large amount of manual time uploading the specific photos affected.