How to display PDF from database in table database element?

In a database I uploaded a PDF file. But when I create the table to display the info it does not have place for the PDF to show or it’s download link. How do I add the PDF (or doc file) to be displayed as downloadable from the database table element?

It’ll be great if someone post a video explaining on this.

Thanking in anticipation.

Hey,
In order to link a table to a document, you should do the following:

  1. Bind the table to the relevant DB collection.
  2. Add a table column.
  3. Link the table to the PDF document.

You can view the explanation here . Moreover, I’ve added a screenshot for you to demonstrate:

Have a good day,
Tal.

Thanks Tal!

You solved my problem. Thanks again

Hello Tal,
One more guidance needed please!
I have a dynamic page, which displayed data extracted from database, based on user input, perfectly! Now, this database also has a document field, how do I connect this data being displayed in table element with the document filed so that it can be downloaded?
The table element here is not connected with the database and is accessed and displayed through code only.

Following is the code am using

import wixData from ‘wix-data’;

//1. The collection to be search is named ‘JudgmentNotes’.

//2. The field in the collection to be search is named ‘held’.

//3. Search button’s ID is ‘searchButton’.

//4. Table component is ‘resultsTable’

//5. Search input component’s ID is ‘searchInput’

export function searchButton_onClick(event) {
//create a variable that will hold the search value.
//get that value from the search input component.
let searchValue = $w(‘#searchInput’).value;

 //build a query for the 'JudgmentNotes' collection 
 wixData.query('JudgmentNotes') 
    //add a 'contains' condition to the query. 
    //have the query look in the 'held' field. 
    //instruct it to look for the search value the user typed. 
    .contains('held', searchValue) 

    //actually run the query 
    .find() 
    
    //when the query returns: 
    .then(res =>  
    { 
        //get the items found from the result set  
        //place the results in a variable called 'foundItems' 
        let foundItems = res.items; 
        
        //now find the table component and make it display the results. 
        $w('#resultsTable').rows = res.items; 
    }); 

}
//-----------------------
export function partySearch_onclick(event) {
//Add your code for this event here:
//create a variable that will hold the search value.
//get that value from the search input component.
let searchValue = $w(‘#partyInput’).value;

 //build a query for the 'JudgmentNotes' collection 
 wixData.query('JudgmentNotes') 
    //add a 'contains' condition to the query. 
    //have the query look in the 'held' field. 
    //instruct it to look for the search value the user typed. 
    .contains('title', searchValue) 

    //actually run the query 
    .find() 
    
    //when the query returns: 
    .then(res =>  
    { 
        //get the items found from the result set  
        //place the results in a variable called 'foundItems' 
        let foundItems = res.items; 
        
        //now find the table component and make it display the results. 
        $w('#resultsTable').rows = res.items; 
    }); 

}

With the ‘title’ Field Key, I need the ‘document’ Field Key connected.

Please guide, how to go about it.

https://www.wix.com/corvid/forum/community-discussion/how-to-display-pdf-from-database-in-table-database-element

This is an old post from 2017, being closed as already solved.

That link is to this very same page.