Save a PDF on form Save (workflow) and Create Link viewable in App

Hey All,

So Im wondering How one would create the Link to a pdf File in the app.

I would create a pdf on form save but I would than want to Generate a File link to this form and save it in a column so a user can view generated pds for all rows and download.

Has anyone does this before,Is there a sample app that depicts this?

0 12 1,895
12 REPLIES 12

It has been done before. But I donโ€™t know how exactly. Do a search in this forum as Iโ€™m sure someone has detailed how it can be done.

I always search before I post to try to avoid posting pointless stuff. If you could find it I would be thrilled Ive searched around but I cant

Any Ideas?

Does this help you. @WillowMobileSystems and other community members have some excellent discussions on the topic in the post below.

Yes, you can do this and itโ€™s described in the post included by @Suvrutt_Gurjar. You may want to start reading from Post #15 in that thread to get to the meat of how it was implemented.

Unfortunately, as far as I know, there is not a way to capture the automatically generated filename when you are saving a PDF from a workflow. But you can specify which path and filename to use.

I created my solution as a two-step workflow to generate invoices:

  1. Creates the path + filename and saves it into a Files table - along with any pertinent info.
  2. Generate/Send PDF using the path + filename saved in step one. Because Step 1 saves to a different table you do have access to the changes immediately within the workflow to use when generating.

Correct, there is not a way to discover the generated filename.

Since this post was written, if you are using Google, there is actually a better way to retrieve and display these generated files.  All other datasources will, unfortunately, still have to rely on the workaround I posted above.

AppSheet now has a feature that allows Google folders to be added to the app and treated like a data table (see image below).  This table provide the metadata for the file including the complete filename.  

The idea is:

  1. When generating the file, supply a custom filename in the automation step that you can use to uniquely identify the file you want.
  2. Add the Google folder, where the file is saved, as a table in the app.
  3. If necessary, add a Virtual Column to the file table to extract the portion of the filename you can use as a data label - plus add any other helpful columns.
  4. Use the folder table to assign the file to any other app data rows in order to view the file, send as an attachment, etc.
  5. You can also build views against this folder table to see a list or gallery view of files.

How to Add a Google Folder as a Table

Screen Shot 2022-08-25 at 8.39.17 AM.png

Screen Shot 2022-08-25 at 8.40.18 AM.png

I am not saving these files in/ through the app. In other words, the saving of the pdfโ€™s in my folders in done through shared drive (many users do this). If I am not originally saving the pdf in the app, how can I find that pdf in a folder system?

If you check my last post in the tips and tricks section (controlling file names of uploaded files), you can imagine this is possible IF you are using Google Drive.

The Apps Script I posted there is able to retrieve the file and rename it, then return the new name and save it to the table column.

You will only have to tweak the script to return the file URL instead of the new name.  

Appscript has a function called .getUrl() so just plug that in somewhere in the script where the if(filename.includes("checkNo") { } function appears 

Hi there !

I'm bouncing back on this old post to share my problem with you.
I read a post on WillowMobileSys's forum (link), where he allowed users to see the history of reports generated for an item. He created an action button that links to the view with the report history.

I used the method mentioned above by linking my folder (Files) where the reports are saved to Appsheet. I then linked the [File] column of the Files table, to the [Report link] column of my Inspection table.
I created a workflow to generate a report when a new line or a modification is made in my Inspection table.

Currently I am having some problems.
- When I create a new line in my Inspection table or modify the line => The report is not generated and it does not update.
- When I click on my action button to see the report history for the same Inspection line => I only see one report and it does not correspond to the inspection line I want (not the good filter).

I put you screenshots of the different elements.

My table Files :

Laurine_0-1661481856393.png

The column in my table Files.

Laurine_1-1661481873295.png

The colum Link in my table Inspection who are link to my table Files.

Laurine_2-1661481929522.png

My Event : A new inspection record is created or updated.

Laurine_3-1661481974433.png

My process : generate a report when the event is true.

Laurine_4-1661481991027.png

If you want any other pictures told me !

Hi @Laurine !   Let's focus on getting the report generated first.  

First check the Monitor page to see if the Bot is running at all and if there are any errors reported.  You can get to the Monitor page with a button named "Monitor" at the top of your Bot.  You then need to make sure you have selected your app on the left hand-side.  Then select the "Runs" tab at the bottom.

Once in the "Runs" page, scroll through the list in the Bots panel to see if your problem Bot is showing.  If it is that means the Bot IS running and now you just need to see if any error was reported that prevented the Bot from completing successfully.  See image below.

Let us know what you see for your Bot execution in the Monitor screen.

Screen Shot 2022-08-26 at 9.09.02 AM.png

All is running well now ! I have found the solution by myself.
Nevertheless, I have a question about how to display the documents history of one inspection. Because actually, when a create a new inspection I receive the pdf document by mail and I can also see it into the app. I would like to see the history of documents generate for the same inspection.

Top Labels in this Space