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.
User | Count |
---|---|
32 | |
31 | |
30 | |
19 | |
17 |