View "In Content Document"

I see that I need to use "In Content Document (in record context).  How can I within skuid get the functionality to preview so I don’t see that it is salesforce?

Or get the functionality of this page within a Skuid page?


You can get the preview portion using an Image component and this URL.
This link will render the first page of PDF, Word, Excel, PowerPoint, and most image types:


Here is a page that you can use in a Page Include component.  You just need to pass in the Id of the ContentDocument record for your file.  The Query String should be like this:

Page XML:




    <p style="text-align: center;"><span style="font-size:16px;">Title: {{{Title}}}</span></p>






Thanks Bill.  How can I open a lightning page:
that does not have the header and footer information.  Ideally in a page include in a popup.  I like the lightning presentation of the document viewer.

Might look like this:

Hi Bill. In another thread, Zach responded explaining that Salesforce doesn’t offer any way to remove the Lightning header. So, instead, you can explore using Skuid to share the links to the documents themselves, which should not have a Lightning header when clicked. I’m not quite sure what your entire use case is, but I hope this is helpful. 

I am trying to retain the functionality of when an image is clicked and I get the popup with all the options.

Hi Bill. Please see my response on your related Community post: for more information about the models needed.

To get that particular popup functionality, the easiest solution is to use the out-of-the-box “Related List” for Files on your Lightning Record Detail page, alongside your Skuid page. Here’s what that might look like:

I am trying to create a URL {{#urlDecode}}{{LatestPublishedVersion.Id}}{{/urlDecode}}/view  

I want it to merge like this:

But I am getting this:

What am I missing


Since you just need the Content Document Id, you can remove the {{#urlDecode}} and use the ‘triple mustache’ for the id like this:{{{LatestPublishedVersion.Id}}}/view



The variable does not get merged.  

Based on the following:

Global Functions

  • urlEncode / encodeUrl: for URL-encoding merge data so that it can be safely added to a URL. Equivalent of JavaScript’s encodeURIComponent function. Example: /apex/skuid__UI?page=LeadsWithCompanyName&companyname={{#urlEncode}}{{companyName}}{{/urlEncode}}
  • urlDecode / decodeUrl: for decoding URL-encoded merge data. Equivalent of JavaScript’s decodeURIComponent function. Example: {{#urlDecode}}{{$Param.companyname}}{{/urlDecode}}
I thought in a URL merge i needed to urldecode?

In any case your recommendation resolves like this:



What component are you using to ‘open’ the URL?  Is it a Button or Template?  If so, you should make sure that the component references your Model.

If it is a Template ‘field’ or a component that references a different model from the one you are getting your LastestPublishedVersionId from, then you may need to use the model in the merge syntax.  Something like…{{{$}}}/view



Hello Bill.  It is a deck with an image inside the deck.  The deck is referencing my record “CR_File_DNA__c” . The interaction on the image is a click with a Go to URL.  The image is referencing the “ContentDocument” with the Go to URL of{{{LatestPublishedVersion.Id}}}/view

Here is a video of the same:


In looking at your video, I think the setup of your deck needs to be adjusted. I think you should set your Deck component to use the ‘AccountContentDocumentLink’ model. In your AccountContentDocumentLink model, add the field ‘LatestPublishedVersionId’ which you can see ‘through’ the ContentDocumentId field. Then you can change the URL on your Click action to be:


You can also try this simple page. It’s meant to be used in a Page Include. You must have Lightning Experienced enabled and you need to pass 1 parameter:


Where the ‘linkid’ is the Id from your "CR_FIle_DNA__c’ object (or any other object that supports Files (i.e. Account, Contact, Opportunity; etc.).

This page only uses the ContentDocumentLink object.

<skuidpage unsavedchangeswarning="no" personalizationmode="server" showsidebar="false" useviewportmeta="true" showheader="false">
        <model id="ContentDocumentLinkPI" limit="20" query="true" createrowifnonefound="false" datasource="salesforce" type="" sobject="ContentDocumentLink">
                <field id="ContentDocumentId"/>
                <field id="ContentDocument.Title"/>
                <field id="LinkedEntityId"/>
                <field id="LinkedEntity.Name"/>
                <field id="ShareType"/>
                <field id="Id"/>
                <field id="Visibility"/>
                <field id="ContentDocument.LatestPublishedVersionId"/>
                <field id="ContentDocument.LatestPublishedVersion.Title"/>
                <condition type="param" value="linkid" field="LinkedEntityId" fieldtargetobjects="" state="" operator="=" enclosevalueinquotes="true" novaluebehavior="noquery"/>
        <deck searchmethod="server" searchbox="true" columngutter=".75em" rowgutter=".75em" model="ContentDocumentLinkPI" filtersposition="top" filterswidth="150px" showsavecancel="false" behavior="flex" verticalalign="top" ratio="1" minwidth="350px" uniqueid="sk-sQAlT-219" buttonposition="" pagesize="10">
                <image source="url" uniqueid="sk-sQE0g-236" datasource="salesforce" behavior="none" model="ContentDocumentLinkPI" url="/sfc/servlet.shepherd/version/renditionDownload?rendition=THUMB240BY180&amp;amp;versionId={{{ContentDocument.LatestPublishedVersionId}}}">
                        <styleitem type="itemsize" width="custom">
                                <styleitem property="width" value="240px"/>
                        <styleitem type="border"/>
                        <condition type="contextrow" field="Id" mergefield="Id" operator="="/>
                <interaction type="tap" direction="either">
                    <action type="redirect" window="self" url="/lightning/r/ContentDocument/{{{ContentDocument.LatestPublishedVersionId}}}/view">
                        <popup title="{{Model.label}}: {{Name}}" width="80%">
                <styleitem type="border"/>
        <styleitem type="background" bgtype="none"/>