<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://community.appian.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>How can I display a document from a link in a grid?</title><link>https://community.appian.com/discussions/f/new-to-appian/20926/how-can-i-display-a-document-from-a-link-in-a-grid</link><description>Hello, 
 I have a read-only grid that is displaying results from an integration that is stored in a variable. 
 I also have a folder that contains documents that are related to the grid rows. 
 I would like to dynamically display the related document</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: How can I display a document from a link in a grid?</title><link>https://community.appian.com/thread/81524?ContentTypeID=1</link><pubDate>Tue, 11 May 2021 03:19:28 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:fef63b57-868d-4120-b4e3-843cd8f689ba</guid><dc:creator>Danny Verb</dc:creator><description>&lt;p&gt;There are two ways to display the image, using &lt;a href="https://docs.appian.com/suite/help/21.1/Image_Component.html"&gt;a!imageField() &lt;/a&gt;which lets you display the image in a cell and the other is using a!documentViewerField() to display the image below or to the side of the grid when selected. I think the easiest option is to use a!imageField() and also provide a download link using a!richTextDisplayField with a download icon.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How can I display a document from a link in a grid?</title><link>https://community.appian.com/thread/81523?ContentTypeID=1</link><pubDate>Tue, 11 May 2021 03:19:09 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:7141a419-84d0-4f16-8efd-bc620904dd10</guid><dc:creator>Mike Schmitt</dc:creator><description>&lt;p&gt;&amp;nbsp;Set a local variable (null by default) to hold the document ID you want to open in the previewer field.&amp;nbsp; Then in the grid column, have a link (use a rich text field instead of a!linkField()) which simply saves that row&amp;#39;s doc ID into that local variable.&amp;nbsp; You already have the document viewer field set up below the grid properly, you&amp;#39;d just tweak such that it points to the doc ID found in that local variable, and only shows up when that local variable value is not null.&lt;/p&gt;
&lt;p&gt;Further: you would only want to enable that link on grid rows where the document is of a compatible type like PDF.&amp;nbsp; In rows for other doc types, you could just have the download link.&lt;/p&gt;
&lt;p&gt;As a side note: when posting code like this, there&amp;#39;s a feature here called &amp;quot;Insert Code&amp;quot; (found in the &amp;quot;Insert&amp;quot; menu here in the comment editor), which will give you a monospace-font code box to paste multiple lines of code into.&amp;nbsp; Most importantly is that it retains formatting like indentation and thus makes code a lot more readable when posted.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>