Opening PDF file

Hi all,  so recently i created an app that will generate a report in pdf ( timestamp disabled), template everything is done, and action to open file is also set, but when i open the PDF in the app vs the one in google drive, despite both having the same naming format, appsheet side is accessing the version before changes... why is that so or how can i get it to open the most recent version? or even a way to overwrite saved files in google if they have the same name etc?

Solved Solved
0 12 306
1 ACCEPTED SOLUTION

Steve
Platinum 5
Platinum 5

AppSheet caches all files. Once a file of a particular name has been cached, that cached copy is all that will ever be provided for that file name. The only way to serve a new copy is to give the new copy a new name.

See also: Control document and image caching

View solution in original post

12 REPLIES 12

Steve
Platinum 5
Platinum 5

AppSheet caches all files. Once a file of a particular name has been cached, that cached copy is all that will ever be provided for that file name. The only way to serve a new copy is to give the new copy a new name.

See also: Control document and image caching

Hello,

If this information is useful!
I always create a numeric COUNTER column and add it to the end of the PDF name in order to generate a new file.

esta es la mejor solucion, creas una columna contador y cada vez q creas un pdf con una accion le pedis que incremente el contador en +1. luego concatenas el nombre con el contador y el nombre del pdf nunca sera igual y cada vez que hagas un cambio podras abrir la ultima version, Es excelente funciona de maravilla

so what im understanding from this is as long as i can find the pdf in drive, delete it and re-generate pdf it should work fine? other alternative would be to sort of make the name "unique"?

Dear All,

after you make column of pdf file and create action to open this file

you need put this expression in the action that open file

[Column that contain pdf link] & "&" & UNIQUEID()

for Example:

1000070861.jpg

This solution help me to solve the same issue that you facing

this mean when you click on action every time the action will open the last version of pdf file

Try it Whilm .. and tell me the result to help others in community

this doesnt exactly work since you change the file path, resulting in an error  that shows the whole HTML format saying file root not found. also this is assuming you had "disable timestamp" disabled... but rather if the file name is eg. 12345 without the timestamp, no matter how many iterations you generate it will still be 12345, with your solution it becomes " open 12345&[uniqueID]" <- file name mismatch will result in file not found....
the only thing i can think of that uses your uniqueID method is that everytime you "generate a pdf", a new row of entry is record, then yes it will work but at this point its just eating up space

no i don't use table for pdf file to record new row everytime generate pdf .. i make pdf on google drive and just make column to pdf file with url even if i change anything in pdf still use the same url

Try again if not success

We can talk by whatsapp to share app or my screen to explain easy than text

It is as according to @Steve , just wait till the cached file "age" out the recent update will reflect. Thanks for all your help on this. Cheers

In this case we should wait and this is not perfect if we want to make changes and want to print immediately 

Or you found way to clear cached file ?

OK i might be wrong but @Steve  do correct and enlighten us if needed...  @KareemElkafi your method only appends the unique ID to the back of the url, which is in the first place wrong already assuming your relative file path ends with ".pdf", resulting in invalid filepath when opening the file... only way i can come up with is that if you have timestamp on and that everytime you "generate" filepath, you delete the previous record, replace with the new one within the row... there should be more efficient ways out there.

this is the topic i found solution in .. take a look in it may be help you

Open current file not Cashed file

https://www.googlecloudcommunity.com/gc/Tips-Tricks/Open-a-file-action-get-current-not-cached-file/m...

I have tested it, and it doesn't work for me, like some of the other users on the thread you posted were saying as well as the author, could be a seperate issue or just not applicable in my case... regardless thanks for the the input tho.