How to Use File Viewers in Noca Apps-thumb How to Use File Viewers in Noca Apps-main

How to Use File Viewers in Noca Apps

In short: Build a PDF file viewer in a Noca app and load real files from Salesforce with an onload event, so users can view documents without leaving the app.

Last updated:

Key takeaways

  • A file viewer component lets users see documents inside a Noca app instead of downloading them.
  • An On Load flow reads the Salesforce opportunity and its related files, then pushes the file into the app.
  • A component mapping node maps the file name and version data so the real PDF loads in the viewer.

How to use file viewers in Noca apps

Build a file viewer and load real files from Salesforce

A file viewer lets someone see a document right inside your app instead of downloading it. In this guide I build an invoice app with a PDF viewer, then wire it to Salesforce so the app loads the invoice fields on one side and the actual file on the other. I left the file loading out of the prompt on purpose so you can see every step. Here’s how to do it.

Watch & Learn


Follow these steps to build a file viewer:

Steps:

1

Write your prompt

  • Describe the app, here it’s create an app with invoice fields on the left and a file viewer on the right
  • Noca confirms the layout and builds a modern invoice app with a PDF viewer how-to-file-viewers-step-1
2

Add an onload event

  • Open Events on the page and choose On Load
  • Create a flow so the file loads as soon as the app opens how-to-file-viewers-step-2
3

Build a flow that reads the file from Salesforce

  • In the flow, read the opportunity, then read its related files
  • Add a component mapping node at the end to push the file into your app how-to-file-viewers-step-3
4

Map the file into the viewer

  • Point the component mapping node at your page and click Add Fields
  • Map the file name and the version data so the actual file lands in the viewer how-to-file-viewers-step-4
5

Go live and save

  • Take the flow live, then bind it to the app
  • In the versions panel, click Go Live on your latest draft how-to-file-viewers-step-5
6

Preview the result

  • Open the app and the invoice fields show on the left
  • The file viewer on the right loads the real PDF straight from Salesforce
  • how-to-file-viewers-step-6

Frequently asked questions

How do I display a Salesforce PDF inside a Noca app?

To display a Salesforce PDF in a Noca app, build an app with a file viewer, then add an On Load event flow that reads the opportunity and its related files. End the flow with a component mapping node, map the file name and version data into the viewer, go live and bind it to the app.

What is a file viewer in Noca apps?

A file viewer in Noca apps is a component that lets users see a document right inside the app instead of downloading it. In Noca's invoice example, a prompt creates invoice fields on the left and a PDF viewer on the right, and a flow loads the real file from Salesforce.

Why isn't the file showing in my Noca file viewer?

In Noca, a file viewer only shows a file once a flow loads it. Make sure an On Load event flow reads the related files, that a component mapping node maps both the file name and the version data into the viewer, and that the flow is live and bound to the app with its latest draft set to Go Live.

Back to top