- 30 Aug 2021
- 2 Minutes to read
- Print
- DarkLight
Updating Displayed PDF on Upload
- Updated on 30 Aug 2021
- 2 Minutes to read
- Print
- DarkLight
Overview
Example Lab Details | |
Version | 7.6.0 |
Root Folder | Example Lab - Updating Displayed PDF on Upload |
Modules | None |
Dependencies | None |
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.