Updating Displayed PDF on Upload
  • 30 Aug 2021
  • 2 Minutes to read
  • Dark
    Light

Updating Displayed PDF on Upload

  • Dark
    Light

Article summary

Example Lab Article
While Example Lab projects are resources for public use, articles and assets are not actively maintained. Screenshots and features are from the specified version below. These references may become dated as new versions are released.

Overview

Example Lab Details

Version7.6.0
Root FolderExample Lab - Updating Displayed PDF on Upload
Modules None
DependenciesNone

This Example Lab demonstrates how to update a PDF shown in a Form's Document Viewer to show the most recent PDF uploaded.


Explanation

This example comprises of two Flows, a Folder of example PDFs, and a Defined Database Structure for storing PDFs. To start this example project, select the "Add Files to DB" Flow. This Flow prompts the end user to upload a File by listing the input "File_Added" with the FileData data type in the start step. Next, the CreateDefinedEntity step, named "Add PDF to Database" and found in User Defined Types > Database Structures > PDF_DB > Create PDF_DB, adds the uploaded PDF File to the specified database. Under Inputs, the Build Data input mapping type creates the "PDF" input shown in the screenshot below. To save the uploaded file, select the input mapping for "PDF" as Select From Flow then choose the "File_Added" input. When debugging the Flow, run the "Upload ExamplePDF1" unit test shown on the left column to use the provided materials. If running the Flow, please download the example PDFs found within the "ExamplePDFs" Folder and upload "ExamplePDF1". Close this Flow. 

Open and run the "Update on Upload" Flow. The GetAllDefinedEntities step, named "Get All PDF in Database", collects all PDFs stored to the specified database. The "Display New PDF" Form utilizes a Document Viewer tool to display a PDF in this case ExamplePDF1. To configure the Document Viewer, open the Form Editor, click the Document Viewer, and select it's input type as FileData and it's data name as "PDF DATA". After closing the Form Editor, click back on the Form to view it's inputs. Notice "PDF DATA"'s input mapping is Select From Flow to designate the Results.All PDF.Last pathing which displays only the most recently uploaded PDF to the end user. To prove this, exit this Flow and run the "Add Files to DB" again instead uploading the second provided file: ExamplePDF2. Now when the end user runs the "Update on Upload" Flow, they will see ExamplePDF2 since it is the most recently uploaded file.

Reference Articles


Project Download

The examples attached were developed to be instructional and were not developed as officially supported components. For more information or to engage our service team to develop fully supported, production quality solutions, please contact services@decisions.com. Import the project below to a Decisions environment on version 7.6.0 or later using our Importing/Exporting article.





Was this article helpful?