How to show an attachment in the Feature/Long Feature Description
Hi everyone!
I have a layer that has Attachments and I want to view them in the Feature Description and Long Feature Description, but I cannot figure out how to do it? The only way to view the Attachment is to click Additional Details and scroll through the attributes before I have the option to view my pdf attachment. Also, Does anyone know a way to turn off unwanted columns in my Additional Details?
Thanks! Bill
/customer/servlet/servlet.FileDownload?file=00P6000000eltycEAA /customer/servlet/servlet.FileDownload?file=00P6000000em1DAEAY /customer/servlet/servlet.FileDownload?file=00P6000000em19rEAA
-
You can turn off the extra field details in the field tabs by clicking on the eye the search icon also prevent searching the particular fields as well.
To get the attachment to the PDFs switch to code view in the feature description/long description window and create a link to
it with html 'm assuming you have a field with the url links... Something like this <a href="{Attachment}" target="_blank" style="font-style: normal;">View Attachments</a>
0 -
Hi Cattyann,
Thanks for replying. I finally figured out how to click the eye to prevent the column attributes from showing in the Details, after clicking the View Additional Details link. So thank you for that! My struggle was figuring out that I had to add all of the fields in the Field tab of the Map features in order to get the Eyes to show... Then I was able to make them not visible.
As far as getting my attachment to show in the feature/long feature details, your solution will not work. I do not have a field with the url to refer to. It is an attachment that is joined to the feature using a relationship class that refers it to a table which contains a Blob. The blob file is my pdf attachment.
Thanks again though. Your imput was very helpful!
0 -
Hey Bill,
Curious if you found a solution to your attachment question? Please let me know.0 -
I've done something similar to show attached photos. The first step is to create a one to one data link to get the related attachment ID:
SELECT AttachmentTable.ATTACHMENTID
FROM MyLayer INNER JOIN
AttachmentTable ON MyLayer.OBJECTID = AttachmentTable.REL_OBJECTID
WHERE MyLayer.OBJECTID = @Id
The second piece is to put the attachment link in your feature description:
<img src="https://MyServer.org/arcgis/rest/services/Features/MyFeatureService/MapServer/MyLayerId/{OBJECTID}/attachments/{MyDataLink.ATTACHMENTID}?token={MapServiceToken}" width="75%">
I would think you could something similar with linking to the pdf using an <a> tag instead of an <img> tag.0 -
As our data is archive enabled I needed to add a little more to your great suggestion John...
Data Link:
SELECT AttachmentTable.ATTACHMENTID
FROM MyLayer INNER JOIN
AttachmentTable ON MyLayer.GlobalID = AttachmentTable.REL_GLOBALID
WHERE MyLayer.GlobalID = @globalId and MyLayer.GDB_TO_DATE = '9999-12-31 23:59:59.0000000' and AttachmentTable.GDB_TO_DATE = '9999-12-31 23:59:59.0000000'
Feature Description:
For some unknown reason the image will only display in the Feature Long Description for our site. GXE462 and Viewer HTML 5.2.7.1
Is it possible to show many attachments?? This link ...
<img src="https://MyServer.org/arcgis/rest/services/Features/MyFeatureService/MapServer/MyLayerId/{OBJECTID}/attachments/{MyDataLink.ATTACHMENTID}?token={MapServiceToken}" width="75%">
...only returns one attachment.0 -
Unfortunately no. You can only use one-to-one data links in feature descriptions. The closest thing you can do is put a link in your feature description to open the feature details, where you can then see one-to-many data links.
<a href="command:ShowFeatureDetails?{$Feature}">View data links</a>0
Please sign in to leave a comment.
Comments
6 comments