<?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>Hide Preview Button Based On File Extension</title><link>https://community.appian.com/discussions/f/data/27769/hide-preview-button-based-on-file-extension</link><description>So I have an interface with a grid that allows the user to preview or download a document. I want to hide the preview button if the file extension of the document is pdf. 
 Initially I was going to use showWhen but I wondered if a!foreach would also work</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: Hide Preview Button Based On File Extension</title><link>https://community.appian.com/thread/107989?ContentTypeID=1</link><pubDate>Wed, 15 Feb 2023 16:35:55 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:c57e6f8e-115b-497a-a47c-237c4da6fe95</guid><dc:creator>davinar9817</dc:creator><description>&lt;p&gt;Hiding the preview is just a little exercise! It&amp;#39;s not actually going to be implemented.&lt;/p&gt;
&lt;p&gt;Although I did get this error&lt;/p&gt;
&lt;p&gt;&lt;img alt=" " height="31" src="/resized-image/__size/640x480/__key/communityserver-discussions-components-files/16/pastedimage1676478995278v1.png" width="367" /&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Edit: Fixed it and it seems to work now&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Hide Preview Button Based On File Extension</title><link>https://community.appian.com/thread/107988?ContentTypeID=1</link><pubDate>Wed, 15 Feb 2023 16:26:16 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:2102b332-3bbb-4db9-baa2-b806806594cf</guid><dc:creator>Mike Schmitt</dc:creator><description>&lt;p&gt;This is rudimentary of course but it should be a matter of setting, say, the &amp;quot;disabled&amp;quot; parameter to &amp;quot;TRUE&amp;quot; when the extension is &amp;quot;PDF&amp;quot; (though, separately, i&amp;#39;m confused why you&amp;#39;d want to hide preview for PDFs, as PDFs are one of the best things that CAN be previewed in Appian&amp;#39;s Document Viewer Field...)&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="java"&gt;a!buttonWidget(
  label: &amp;quot;&amp;quot;,
  icon: &amp;quot;eye&amp;quot;,
  tooltip: &amp;quot;View&amp;quot;,
  value: true(),
  disabled: document(fv!row, &amp;quot;extension&amp;quot;) = &amp;quot;pdf&amp;quot;,
  saveInto: {
    local!preview,
    a!save(local!selectedDocument, fv!row)
  }
)&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>