I use workflows to generate and send customer pdfs from templates in Google. Currently, I use the archive option to save the generated result in the default location in Google with the current timestamp to ensure file name uniqueness.
When certain record info changes, a new file is generated with the updated details and saved as a new file. I would like to be able to retrieve the history of all saved files associated with a certain record and display them in the app - as a list or gallery.
What is the easiest/best way to be able to keep a file history, view that history and still know which file is most recent to send out to customers upon need/request?
@Aleski - I was indeed referring to column of type File. I read this:
"Constructing an Attachment File URL
"YourAttachmentFileName" must specify the Attachment Folder Name followed by the Archive File Name. Omit the Default app folder name. Calls to โwww.appsheet.com/template/getappfileurlโ automatically prepend the Default app folder name."
I took this to mean that I can use my column File type and AppSheet will add the necessary bits for the URL.
This also leads me to a questionโฆWhat is expected to be written in terms of path + filename+ extension to the column of File Type? When I write only the โfilename.pdfโ, and then try to view that file, I get an error that file cannot be found (see pic below).
Only when I update the File column text to โappsheet/data/ServiceInsightDemo-526414/Files/Estimate_p7fudBEC_2019820_10_43_33.pdfโ, is the file able to be viewed from the app. Bu this is WITH the default app folder which seems to contradict the paragraph above.
The other puzzling thing is that in the error it seems it is trying to use appName variable = โServiceInsightBase-526414โ to create the URL. I have the Default App Folder as โ/appsheet/data/ServiceInsightDemo-526414โ. The files are written to the Default App Folder as expected. But even copying files to a folder for appName (under appsheet/data), the file is not found.
@WillowMobileSystems
I had the same problem. Then I found the reason: My Table and my file folder were outside the App folder. That happens when you create a Sheet, then an App an then forget to copy the sheet into the App folder
Hi Fabian
Iโm trying to troubleshoot why I canโt open the file I generate in the app and found your comment.
Is it really required to have the spreadsheet inside the app folder?
I couldnโt find this written anywhere in the Appsheet documentation
Update: Unbelievableโฆ This has solved my problem. Thanks!!!
@Steve, can we get this documented somewhere? (unless I missed it)โฆ
Yes, at least in some cases, I believe it is correct that currently the file/item folder path is based on the location of the sheet. I have not played with this in a dedicated fashion to determine if in all cases this holds true. And what happens when its a database?
However, I believe this to be a flaw. It is my strong opinion that all pathing should be based on the Default app path set in the app regardless of where the sheet is located. I think I opened a Feature Request for this a long time ago. Maybe its time to find it, dust it off and resurrect it?
Yes please have my upvote. It makes sense to think itโll default relative paths from appfolder and not the spreadsheet location. This not only makes it breaking change when moving spreadsheet, but it is also very unintutive, what if you have sheet on one data source and image on other.
I wish to add my vote to this behaviour. Does AppSheet have a feature request for this?
Adding @praveen for more insight on this
Hereโs an answer from Praveen on this issue:
Iโm really struggling with this one! Can you send a screenshot of your Action set up to create the filename?
Also, having created a specific folder for these pdfโs to go into, it has decided to put them in another folder which I had to dig around and find as it had created multiple layers of folders.
Sure! As I mentioned above i create the filename in 2 parts.
The below expression creates a name like "Invoice_c98a86fb_20190914_11_38_01"
Note the use of SUBSTITUTE(). I found that the Workflow steps replace the โ:โ in the time with slashes. This is why you are seeing layers of folders most likely.
In this expression, the text โappsheet/data/ServiceInsightDemo-526414/โ is based on your App Default Path. When writing the actual files, the app default path is used. However, when the files are retrieved, the default path is NOT used so you have to include in the built file path+name.
Digest this and let me know what further questions you have.
hi
i followed your instructions on how to name the file
i cant seem to open the file from the app.
do i need to make the column a url? a file?
i get an error when i try to open it
For a file, the column should be defined as type โFileโ.
First, make sure you can open the physical file from the source.
Next, make sure you have the path to the file properly captured. In the app, you will have a Default App Path property. The application will start from there to try and find the file. Any additional folders involved will need to be included in the sheet File column.
For example, I have a Default App Path property defined as
"/appsheet/data/ServiceInsightDemo-526414"
From that location, my files are physically stored in a folder named โFilesโ AND then another folder that is the name of the Order # of the record the file is created for. So if that Order # = โ20200115Eโ then the remaining folder path would be:
"Files/20200115E/"
If my filename is โInvoice_20200115E_20200115_22_46_32.pdfโ then I MUST have in my sheet data in the File column the value of:
/Files/20200115E/Invoice_20200115E_20200115_22_46_32.pdf
NOTE: I may have been able to place the "Files/20200115E/"
folder info in the AppSheet column definition and then only have the filename itself in the sheet. I created this before I realized the folder property was there. I will at some point make that change as it will save on amount of data in sheet which will improve performance. Every little bit helps!!
This works perfectly. Thank you so much @WillowMobileSystems .
It seemed much more complicated than what it actually was.
thanx for the quick reply
i have the file creation action, and i get the file location information in the colomn.
but when i click on it i get an error message:
" 404 - File or directory not found.
The resource you are looking for might have been removed, had its name changed, or is temporarily unavailable."
the reports are stored in : appsheet/data/qctest-310438/PRD00125636/PRD00125636.pdf
but my google sheet is in a different library. i assume that is the reason that i cant open the fileโฆ
what do i need to do in order to get the file to open when it is in a different location?
Are you using concat expression to construct URL dynamically?
Use encodeurl() expression within that formula.
hi
substitute(concatenate([ืคืงืข], โ-โ, day(today()), โ-โ, index(list(โ01โ, โ02โ, โ03โ, โ04โ, โ05โ, โ06โ, โ07โ, โ08โ, โ09โ, โ10โ, โ11โ, โ12โ), month(today())), โ-โ, year(today()), โ-โ, timenow()), โ:โ,"-")
to create a unique file name.
concatenate(โappsheet/data/qctest-310438/reports/โ,[ืคืงืข],"/",pdfreports[name], โ.pdfโ)
File path seems to have issue.
pdfreports[name] should return the โlistโ I suppose. The file path should NOT be list type.
My suggestion is just test it step by step. First, you delete file path and bring it back to default.
Then re construct the url.
in your case, own file path name make the things complicated, so do a step by step approach to debug.
hi again
just wanted to say thank you all for the great help, i got it working finally!
Hu Guys, how are you doing ?
Doing some research here on the community I came to this awesome topic.
I was wondering if I could count on you to help me with Get Url formula.
Firstly I used the formula suggested on this link https://help.appsheet.com/en/articles/2744751-email-attachment-file-archiving and It worked. Then for some reason the suggested formula stopped running.
Please find on this link a demo video to better show the problems I am facing https://drive.google.com/open?id=1KwL47Gwzsccp_kWd3c2jYPFaXiovnaHa&authuser=costa%40costaevalle.com&...
On this video the formula was working https://drive.google.com/open?id=1L0kAiJv8ETAW5yKtkq9kCIGGnsd_iVV9&authuser=costa%40costaevalle.com&...
Kind regards,
Hey Guys, I am trying to make my emailed attachment pdf to be aaccessible from the link in the app. I am trying to understand the basics of linking to one specific file on my google drive for now. I canโt get it to work. The file path in the google drive is mydrive/appsheet/data/attachments/SITECH_723242305_V15.pdf
I have a column that is a FILE type. My initial value is URL to the file which looks like this.
I get 404 file not found. What am I doing wrong?
Thanks,
Firstly, the paths of your stated G-Drive location and that used in the Initial value are not the same at all.
Second, is this a file that is generated from a workflow? If so, it my understanding, that the storage path of the file is based on the location of your data sheet.
I will guess that your sheet is stored at mydrive/appsheet/data
. When an email workflow is run and no path is specified for saving of the generated file, AppSheet will use the folder โAttachmentsโ by default (if I remember correctly). This means any generated files by this workflow will be stored at "mydrive/appsheet/data/attachments"
In the app, when attempting to specify the location of the stored file, you need only specify the path from the sheet root folder which in the example above is the "data"
folder.
So you would want to use the path "/attachments/SITECH_723242305_V15.pdf"
in your File column.
Thanks for the tip John. However my sheet is actually in the root directory of my g drive. But you are correct the attachements are stored in appsheet/data/mynewapp-505828/Attachments.I tryied this link as you suggested
/www.appsheet.com/template/Attachments/SITECH_723242305_V15.pdf"
didnโt work
I have seen a conversation above that the sheet needs to be in the myNewApp-50582 directory for the links to work. I moved it and it broke everything. I have pictures and signatures and barcodes in that sheet. they all started acting wonky. And by wonky I mean not displaying randomly. Moving back didnโt fix it. So I had to delete the source in appsheet move he sheet and reconstract everything. Sorry I side tracked.
I also tryied using this expression
and i just get this in my browser adress
https://www.appsheet.com/template/appsheet/data/appName=MyNewApp-505828&fileName=ENCODEURL(
So my syntax is wrong i just dont know where?
Hi @SITECH_Mid-Canada I think you use a Workflow to send a PDF as an E-Mail and archive it to your Google Drive.
So your workflow setting includes โAttachAndArchiveโ.
In โAttachment Folder Pathโ you can set your own path. But: this will always be located in the folder where your google sheet is located.
Out of the box it will save your PDF files to:
"mydrive/appsheet/data/YourApp/attachments"
I would also recomend to disable Timestamp.
Everything you need to know is written in this help article:
You are exactly right. I generate a PDF from a template and it is stored in a default directory. What I am trying to do next is put a link to this PDF directly into my sheet. It is usefull if I want to say print the pdf from the app without having to look for it in the emails.
Please see at the bottom of this article
โConstructing an Attachment File URLโ
If you are using Microsoft instead of Google you can easily use Power Automate to save the name of the archived file into an Excel table which can be viewed in App.
3 columns
Report Date,
Report Name,
Report Link (=Hyperlink(Report Name)). This is a an Excel formula
Save and Archive using workflow.
Use MS Power Automate to create a workflow
When a file arrives in specified folder
Get file info
Add a row to Excel table with file info
This runs automatically every time a file arrives in specified folder so Excel table is always up to date
Thanks I will consider this as my fall back plan if I cant figure out this โlinkโ thing.
Does this only work if you are building/generating the pdf in/through the app? Or can I use this to search a drive and find a pdf with CONTAINS?
Hi @Tiger would that be a solution for you?
https://help.appsheet.com/en/articles/4865398-folder-data-source-the-essentials
Sorry - I was out for a while. Thank you so much for the help. Let me look at this and seeโฆ
It seems that what @Fabian has suggested is the way to go IF your documents are stored in a Google Drive folder. it appears that is the only Folder source that is supported at the moment.
I donโt see โDocuments on Google Driveโ anywhere. What about Onedrive? Is that an option?
And - btw - no the documents are NOT stored in ANY cloud. They are in a shared drive in my companies server - this is where all employees dump that info. They want me to get it (pdf) and allow the user to print that pdf - inside the folder of the shared drive.
At the moment, you cannot yet use an AppSheet app to select files in folders on a local network server to view, print or attach to an email. They would have to have been added into the app first.
AppSheet seems to be moving in that direction by allowing such a search and find against Google folders. By the way, the screenshot I included is presented after clicking on the Add Table button.
If it is necessary to gain access to those files from the AppSheet App, is there anyway they could be moved to Google or a copy placed on Google where the app can gain access to it?
If not, then Iโll have to rely on others to respond with any know workarounds.
I am doing JUST that - moving to Google. Only problem is - they are updated daily. Meaning - new invoices are loaded daily. So looks like ill be copy and moving daily. Thanks for the helpโฆ
Question - I loaded a test file/folder. How Do I print pdfs from it?
I have files inside folders - It did not drill down - is it suppose to?
Did you try applying the suggestions from @Fabian 's post above? I havenโt tried it out yet myself.
Let me go back and look. Thanksโฆ
User | Count |
---|---|
41 | |
31 | |
31 | |
16 | |
14 |