Hey everyone. I’m having a problem with a File column always showing an older version of a PDF (said PDF is created and updated via a workflow in the app).
This gives me a column that I can click on to open the saved file… and all this works.
Until I make a change to the PDF; then I don’t see the newly updated file, instead I continue to see the version of the file that I opened immediately after it was created.
For example: say I trigger the workflow to create the invoice file and write the file path to the File column: after the sync cycle for creating the PDF is complete, I can click on the File column to view the file - and it works. Then if I make a modification (say some rewording of a line item or something) and re-trigger the workflow (which updates the PDF), when I tap the File column to view the file I still see the first version - but if I go and check the file in the cloud it indeed has been updated.
It’s like the system is caching a version of the file and showing me this, instead of pulling the file from the cloud when I click on it.
It has been about a 1/2 hour since I’ve made the last update to the file, and I’ve tried all of the above again to no success. (I was thinking maybe it was a time based thing: you know, we only check the file to see if it’s been updated every 30 min or something…)
I would just use a “GetAppFileURL” and make it work that way - but things are changing and that won’t work for very long.
@Phil any help would be appreciated.
If you are reusing the image file URL and directly updating the contents of the image file, you will only see the updated image value once the cached image ages out of the Cloudflair cache.
If you enable “Secure Image Access” we do not cache the image in Cloudflair and image retrieval performance will suffer. You can enable “Secure Image Access” by going to Security > Options in the Editor.
I’ve always been under the impression that the cache time is huge, to the point that reusing a file name for downloadable content or images is discouraged.
The quoted text is about images, does that apply to PDFs as well?
And does this all mean that “eventually” the newest version will be shown?
Your guess is as good as mine…
Hello @MultiTech_Visions!
I’ve had a similar issue. Seems that it was solved by an workaround: using a sequence of actions. First erase the collumn value for this row then recreates.
But still there is a catch: do not try to open it before the app finish creating the PDF file.
That… sounds like a true work around.
But it makes sense in a way; you clear it, then we put a value there that could be anything (even though it’s the same one) - but this would cause the system to re-ping the cloud for the file.
I know this is an old thread, but just pasting this here as reference.
Still getting the old pdf file…
There is effectively no way to update a PDF or other file made available through you app. If you have a new version of the file to distribute through the app, it must be given a different name. Replacing an existing file with a new file of the same name will not work.
Just to clarify a point in what you said:
You CAN update files via the app, it’s just that the changes won’t be shown in the file you get from the app immediately - you have to wait for the cached version to update. But if you migrate the the actual folder where the files are saved, you’ll see they’re indeed updating.
To update an existing PDF file, simply call the original file creation process again - AppSheet it smart enough to know that it needs to update the file and does so - it’s just that the file “served” by the app is a cached version, so you’ll have to wait 24 hrs or something.
Even if you call the action that created the PDF, if the filename will be the same, then Appsheet will still show the cached version. Steve is correct, you have to change the file name.
The only other possible alternative is to turn off the Store content for offline use in the Offline Sync tab of the Behavior page. Which is not ideal if the app is set to run when offline.
It seemed to me that someone could make the conclusion that in order to update a file you’d have change the filename 100% of the time in order to get the file to update. (i.e. the first filename would be “Invoice_224_1”, then a second would be “Invoice_224_2” and the third “Invoice_224_3”, etc. etc. - and if you didn’t make these changes the file wouldn’t update.)
The following scenario happens every time I make an invoice in my time-tracker (TT iota):
I just checked to see what file would be served up by the app for an invoice file that was generated over 24 hrs ago, and AppSheet showed me the updated file.
Yes. That’s what we are all talking about here already - To show the new version right away.
I assumed that I didn’t have to repeat it in my last reply.
Any solution to see the updated file right away or we have to still wait for 24 hours?
Not sure this tip will help you out, but this is one of the workaround I believe.
I'm facing this exact problem @MultiTech is facing, for regenerating PDF files after editing the row.
I've employed cache busting method proposed by @Koichi_Tsuji at
Open File/Image with external browser without look... - Google Cloud Community
With my current setup for the app, this method poses an interesting interaction. Essentially, this method works but only after a short time period. According to @MultiTech, it takes about 24hrs for the cached version to be updated when the setup does not employ cache busting or other forms of forcing appsheet to display the updated version of pdf file on Google Drive.
In my case, I have discovered that it takes about 4-5 minutes for Appsheet to clear the cached PDF (we'll call it Ver 1), and display the correct, saved PDF (we'll call it Ver 2).
If someone could replicate my process and confirm that this is true it can be helpful for the community. Here's the setup and steps I took to test this:
1. Use Bot to generate a Ver 1 PDF file with a Template on Google Doc, filling in information of the current row.
2. Set value a column called [PDF URL] by using [Key of Row], employing this function CONCATENATE(‘https://www.appsheet.com/template/gettablefileurl?appName=’, ENCODEURL(CONTEXT(AppName)), ‘&tableName=’, ENCODEURL(CONTEXT(Table)), ‘&fileName=’, ENCODEURL(CONCATENATE("your path to google drive", [Key of Row], ".pdf")))
3. Check with Open URL action to see if it correctly opens Ver 1 PDF.
4. Edit the row with new data, then delete ver 1 PDF with a delete action on SELECT(file[_ID], [name] = CONCATENATE([_THISROW].[Key of Row],'.pdf')), this is done to the data table that is created from Google Drive Folder (in Add new Data).
5. Check on Google Drive if Ver 1 PDF is deleted and [PDF URL] is cleared.
6. Generate ver 2 PDF with the new data, and use Open URL action to see if Appsheet opens the correct, ver 2 PDF with updated data. Also check if Google Drive has the correct ver 2 PDF.
7. Repeat step 6 with some time interval to see when appsheet will open the correct ver 2 pdf.
In my case, in step 6 appsheet opens the wrong, ver 1 PDF. However, if you wait for around 4-5 mins, appsheet will somehow open the correct, updated ver 2 pdf. FYI i'm using brave, a Chromium based browser, not sure if that has an impact though.
Please lmk if anyone found another workaround, of if what i'm facing is a common problem.
I avoid all these issues by generating a NEW PDF each time. I track a version number and simply adjust the version number on each filename each time a re-generation occurs.
Additionally, I manage all generated files on Google Drive and use AppSheet's feature of loading a folder as a table source. I parse the filename into Virtual Columns and use those to connect the file(s) to the data row that generated it. This allows me control over the file such as selecting which file to attach to the row (usually the latest), displaying a version history, opening the file and even deleting it.
In some situations, I may want to keep the multiple versions of a file - in case there is any question about what changed. BUT, if I don't, I can create an action or a Bot to delete the unwanted files.
I hope this helps!.
Thanks for the reply. I've tried out this method and seems like its working fine.
One highlight though, even with using version control (appending have "-1" "-2", etc. to create unique file names), for some reason for around 5 seconds after a new PDF is generated, the opened file will still be the old one.
For example, the current pdf version is 1, then I make a change in the row, press generate new PDF under a new name and update [PDF File Location], then press Open File action. Within about 5 seconds after the change, the opened PDF will still be version 1, even though I've checked that version 2 PDF exists, and that [PDF File Location] is properly updated in Google Sheet (database).
I know fixating on that 5 seconds is a stretch, but thought it might interest some people that Appsheet has this quirk.
Hey,
it's simple, your Detail View is not up to date either.
Use something like that and it'll work.
LINKTOVIEW("FilesToOpen_Detail")&"&at="&ENCODEURL(NOW()+1)
Cheers
You're not alone in running into this issue—AppSheet's File column can behave in ways that make it seem like it's caching the file, even though the file in Google Drive has been updated.
Here’s what’s likely going on and how you can work around it:
---
What's Likely Happening
When a File column points to a static file path (e.g., Invoices/INV123.pdf), AppSheet will generate a public access URL the first time that file is accessed. That URL often gets cached by either:
AppSheet's hosting/CDN layer
Your browser/device
Even if you overwrite the file in Google Drive, the underlying URL doesn’t change—so AppSheet (and the browser) might keep showing the cached version.
Solutions / Workarounds
1. Change the File Name with Each Update
Instead of overwriting the same PDF, update your workflow to create a new version with a slightly different filename each time (e.g., include a timestamp or version number):
Example filename formula in the workflow:
"PDFs/INV_" & [InvoiceID] & "_" & TEXT(NOW(), "YYYYMMDD_HHMMSS") & ".pdf"
This will:
Generate a unique filename every time
Avoid caching because the File column will point to a different file path
You can also delete the older versions periodically using an Apps Script or manually, if needed.
2. Use an Image Column Instead of a File Column
Weird trick, but it works. If you use an Image column instead of a File column and point it to the same file path, AppSheet forces a fresh fetch more often. The downside is it won't look like a clickable PDF icon, but it may update more reliably.
3. Append a Query String (Advanced Hack)
Sometimes appending a dummy query string to the URL (like ?v=123) tricks the browser into bypassing cache. But since AppSheet auto-generates the file URL from the File column, you don’t have direct control to do this inside the column behavior. You'd have to implement a Virtual Column with a URL-type and construct a custom file URL manually—this is not officially supported and may break in the future.
Best Practice Recommendation
Use the dynamic file naming with a timestamp. It's the cleanest and most reliable solution. Then, just update the File column with the new path each time.
Let me know if you want help modifying your workflow formula to do this, or to auto-delete older files.
[filePDF] & "&" & UNIQUEID()
User | Count |
---|---|
15 | |
15 | |
8 | |
7 | |
4 |