ArcGIS Online Arcade – Showing Attachments in Popups Using Arcade

arcadearcgis-onlineattachments

I'm trying to follow the instructions in Show Attachments in Pop-ups with Arcade Expressions

I want to show the first attachment in a popup in ArcGIS Online and to do that I need to obtain the first attachment ID using this Arcade expression:

return First(Attachments($feature)).ID

The error I get is this:

Execution Error:Runtime Error: Cannot call member method on null. ID

My attachments are associated with a layer that I cannot share publicly. Unlike the video there is a very long Token ID that runs after the attachments ID. Here's a small section of what I'm looking at:

………/FeatureServer/0/6/attachments/52?token=s9r_RuK9ix5DTY-lcrYXVOJ9GEvJWG…….

How do I write an Arcade expression to obtain the first Attachment ID on a private feature layer?

Best Answer

Your layer needs to be made public.

Related Question