Using Arcade to Display Clickable Attachment Links in Map Tips
I found an article with Arcade Expression Examples, including one for Clickable Attachment Links.
I copied and pasted the code to create an Arcade replacement token for a layer in one of my maps and replaced the URL with the same layer's URL. However, I can't get it to work. It always says "None", even for features that I know have attachments.
The two main differences between the layer in the sample site and the layer that I'm trying to implement this for are that my layer is a map service as opposed to a feature service, and it's secured.
Has anyone else successfully included attachment links in their map tips for a secure service using Arcade Expressions or any other method?
Thanks,
Denise
-
Hi Denise. I just tried this and getting same result as you.
As a test, I tried a simpler arcade expression like this:
return Count(Attachments($feature))
That should return a count of how many attachments for each feature, but nothing is returned.
FYI, tried this with a map service as well as feature service.
So, it seems the Attachments function is not working...
0 -
Thanks for your reply, Zorba. I tried something similar to your expression, but it didn't work for me either. I suspect it's because the service is secured. It's frustrating, but I did manage a workaround. The data for this particular service is stored in SQL, so I used a Data Link to the attachment table to get a count of attachments. Now the users will at least know when to look for attachments.
0 -
Good idea with using data links. That could come in handy for some of our apps as well. Thanks. 0 -
Did anyone get this to work? Same issue here. Unsecured service, tried both map service and feature service. returns 0 with Count(Attachments($feature)) but shows attachments below in the Attachments section so they are definitely there
0 -
Hi Chelsea,
Unfortunately, I have not gotten this to work. I looked at the URL of an attachment by using the link in the Attachments section. I believe we would need some way of getting the token to build it into the URL. As far as I can tell though, Arcade doesn't have the capabilities to grab the token.
0
Please sign in to leave a comment.
Comments
5 comments