I can't view Google Drive PDFs?

I’ve worked for HOURS and for the life of me I can’t view the PDF I made in the app after creating it. It’s driving me nuts. I’ve worked with ChatGPT as well as Gemini and both of them failed. Basically, I create an order. I want to turn it into a PDF. The PDF goes to Google Drive, THEN I WANT TO BE ABLE TO VIEW THE PDF IN THE APP! No matter what I try, it won’t work! Either the code is broken or the view doesn’t refresh. NO, it’s not a folder issue. I can see the pdf IMMEDIATELY in Drive in my Attachments folder. It’s killing me. This is such a basic thing. Any help at all will be appreciated. Thank you!

Hi @EAP_Industries

In the bot menu, look at the test section. There may be an error because the format (column) in Google Docs is not the same as your reference table, resulting in an error, resulting in the PDF not being formed.

Hello @EAP_Industries , @Syamsudin is right. Maybe there’s a column in your Google Docs(Template) that does not match your physical column, which is why you can’t view your PDF file. Or possibly, there is a file path problem?

hello - ONE of the MAJOR problems is that I am using the “new” UI and a lot of people are still using the old. Another thing I don’t understand.

Is your PDF file being opened using the old features?

Hello @EAP_Industries

I made a step-by-step guide on a blog of my own. You may want to activate english-translator, but it is all here: Google AppSheet Automation: Créer un fichier PDF et le récupérer - Codergo

(literally: “create a PDF file and retrieve it”)

thank you - I translated it and am trying to understand.

Thanks - my process IS currently generating the pdf files correctly. They are both appearing in the Attachments table as well as in Google Drive in the /Attachments directory where they belong. My problem is simply that the app will NOT refresh its “PDF Library” vew that I set up to contain all pdfs.


So my issue is not whether the pdfs are being generated. I just NEED TO SEE THEM in the app :slight_smile: !

Thank you for your document - my question. Once the pdf is generated, how can you immediately view it in the app? And my purpose is making an app for salespeople to create orders and quotes. If they make a change, I need the app to update the pdf. I expect that to be a new pdf, which is fine. I a m not looking to modify the existing pdf.

Hi @EAP_Industries

Have you added the generated PDF to Google Drive? Has the folder been changed from restricted to anyone with the link? Have you tried the following link and found it successful? Struggling with AppSheet? Drop your problem here — I'll help you figure it out - #14 by Syamsudin

You cannot. This is a long-standing limitation due to the server-side PDF-creation process. The user takes some action in the app that triggers a bot to generate the PDF. The bot does its work independently, behind the scenes (“asynchronously”, in programming terms). The app doesn’t wait for the bot to finish, and the bot does not notify the app when it’s done. The app user has to go check by syncing the app. To work around this, you can setup the bot to explicitly notify the user of completion and provide the link.

If you re-read my articles, you will notice that I say that the app will offer user to open a file with a known location. So basically, you need to:

  1. define “future file path”

  2. create your file in the expected location, with name matching the “future file path”

  3. for the app to sync for your users.

The whole process requires roughly 20 seconds to 1 minute, depending on mutiple factors. “Immediately” would not apply here.

That will be OK if you follow the instructions given in my article. Basically, each file needs to have a unique name, hence my suggestion to use a timestamp in the file name.

I’m trying to use your method and I think I’m getting close…

Here is the successful pdf and its location:

Orders table results

This Finalize Document is the button you hit to generate the pdf

The View PDF button results in this currently:

***I am sooooo close@! This has to be something small/stupid! :slight_smile: Thanks again for any assistance.

One piece of information that you might be missing here, when you are attempting to reference the file directly from the Google Drive (as opposed through an app Table sourced from a Folder) AppSheet uses relative pathing.

If your tables, namely the Orders table, is using a Google Sheet as the datasource, that Google Sheet’s physical folder location sets the “root path” for the relative pathing. The path written to the Sheet File column must be based on that “root path”.

If you are using a database, the “Default app folder” setting in App Properties determines the “root folder” and your written File column paths need to be based on that as the “root path”

So…assuming…

… a Sheets workbook AND based on your test data showing that your PDF’S are located in an Attachments folder, the Sheets workbook must be stored in the folder ABOVE the Attachments folder- which looks like the “EAPQAOS1COPY…”.

… a database AND that your PDF’S are located in an Attachments folder, then the “Default app folder” setting is expected to be “app/data/EAPQAOS1COPY…”.

If this is confusing, let us know what you are using a datasource for the Orders table. Then we can provide more specifics.

I hope this helps!!

Thanks - well, we finally got it to where it works. We made that virtual table that was suggested, navigated to my Drive and the correct attachment.

NOW the only problem I have left is that the pdf will only appear in the app window after a browser refresh (not an app refresh).

Hopefully that makes sense. On my phone it doesn’t appear at all regardless of how many refreshes/pull downs from the top. I have to log out and come back in to see it.

I can’t get past how to make the Drive file appear in the app or in the browser app window.

Virtual table? I am not clear what approach you are using here.

Since AppSheet rolled out the ability to pull in a Google folder as a Table, I exclusively use that any time I want to be able to view a file from the app. One thing I have noticed, is that it seems to take more time for a generated file to appear in the Emulator than in, say, a Browser version of the app. But, it still takes some time after generation and even after I can successfully view the file on Google, before I can see the file from the app.

All our users are Desktop users. I’ll try from a phone to see if I see any difference - at least in the approach I have implemented.

Sorry that’s what I meant. I brought in the Google Drive table. But in order to see a recent pdf in the app, I either have to refresh the browser or literally log out of the phone app and come back. Not acceptable for mobile users.

Yep. I created an order about 30 minutes ago. I’m using the AppSheet app on my phone. Pulled down. Exited and came back. Still can’t see the pdf in drive via the app.

I ran a test. The PDF was created, I waited 2 minutes on my iPhone and tapped Sync, the View File icon appeared and I was able to open and view the resulting file.

I think if I had waited longer, the app would have updated automatically after another minute or two. I have been trying to test that but running into a weird template issue now that is preventing the automation from running.