This lesson will cover the following topics:

04 | Use Case

01 Getting Started

This tutorial covers how to configure the file viewer widget. The File Viewer allows you to display various file types in your project.

screenshot showing where to find the file viewer in the widgets menu

02 File Viewer Settings

In the content tab, you can choose what file type you want to display.
screenshot showing the file viewer settings menu with the file type options expanded

You also have the option to display a static file.
screenshot showing the file viewer settings menu with the static file option selected

Click Select from Gallery to choose a previously uploaded file or upload a new one. If you choose not to display a static file. You can configure one to display from Salesforce.
screenshot showing how you can add a static file by choosing a previously uploaded file or uploading a new one

03 Displaying a Salesforce File

Add an interactive element to your project to display a file in Salesforce, for example, a button.
1. Click on the Button interactivity icon.
Screenshot showing the button menu with the interactivity icon highlighted

2. Click the Start + and choose Salesforce Action as the node. Click Next.
Screenshot showing the on-click action screen and the add node screen as an overlay with the Salesforce Action node highlight

3. Click Salesforce Integration.
screenshot showing the integration action screen with the Salesforce Integration button highlighted

4. Click Create New under the Get Records tab in the Salesforce Integration screen.
screenshot showing the Salesforce Integration screen with the Create New button highlighted

5. In the Object Settings configure; Files as the Salesforce Object, User Action as the trigger, the number of files to pull, and add a description.
screenshot of the object settings tab in the map salesforce fields window

6. In the Conditions tab, configure a condition that applies to your files. For example, if you only want specific file types to display.
screenshot of the conditions tab in the map salesforce fields window

7. In the Mapping tab, map the file viewer elements to the corresponding Salesforce field. Click Apply.
  • Content - Version Data
  • Type - File Type
  • File Name - Title (This one is optional)
screenshot showing the mapping tab in the map salesforce fields window

8. Use the dropdown to select the get we just created. Click Next, Insert, and Apply.
Screenshot showing the created Salesforce field selected in the Integration Action screen

The current configuration will display files from Salesforce that meet the conditions.

04 Use Case

You can use a power table to display files you have in Salesforce. To view the files, you can click a button in the table and the file will display in a modal.

First, insert a power table into a second project page. When selecting a source in Salesforce, choose Files. We configured a condition that only the latest files must be displayed.

When configuring Mapping, 3 columns were added: Tile, File Type, and a View File button.
screenshot of the salesforce configuration screen

Add a Responsive Modal to your page and insert a File Viewer widget. 
screenshot showing the responsive modal with the file viewer inserted

Add two static page-level variables; type and content version ID. To learn more about variables, check out our Variables Course.
screenshot displaying two added static variables

Navigate back to your power table mapping and select the On Click Action button.
screenshot showing the mapping step of the power table with on click action highlighted

Click the Start + and select Affected Elements as the node. Click Next.
Screenshot showing the on-click action screen and the add node screen as an overlay with the Affected Elements node highlight

Configure the two created variables:
  • Type set value from the power table file type.
  • Content version ID from the power table value.
screenshot of the two variables with set value from configuration

Now that the variables have been configured. It’s time to configure the modal.

Click the Affected Elements + and choose Drawer/Modal as the node.
Screenshot showing the on-click action screen and the add node screen as an overlay with the Drawer/Modal node highlight

Ensure you click the modal tab and toggle the enable switch on. Use the dropdown to select your modal and choose Show.
screenshot showing the show modal configuration

Finally, we need to configure the modal to pull the Salesforce files.

Click the Drawer/Modal + and choose Salesforce Action as the node.
Screenshot showing the on-click action screen and the add node screen as an overlay with the Salesforce Action node highlight

Click Salesforce Integration to create a new Get action.
Screenshot showing the Salesforce Integration button highlighted on the Integration Action screen

In the Object Settings configure; Files as the Salesforce object, User Action as the trigger, the number of files to pull, and add a description.
Screenshot showing the object settings tab for the map Salesforce fields window

In the Conditions tab, configure that the content version ID must equal the corresponding variable.
Screenshot showing the conditions tab for the map Salesforce fields window

In the Mapping tab, map the file viewer elements to the corresponding Salesforce field. Click Apply.
  • Content - Version Data
  • Type - File Type
  • File Name - Title (This one is optional)
screenshot showing the mapping step for the Map Salesforce fields window

Preview your project, when you click the view file button, the modal will pop up and display the corresponding file.
Screenshot showing a preview of how the file viewer works

05 Got Feedback?

Additional Resources