Hello Community members,
I’m trying to view a workflow pdf in the app itself. I’ve gone through the communty posts and figured that there are 2 ways of doing it - one is to create a file name/file column in the table with open file action to it. Second is to create a column for url.
Despite trying both methods several times - im getting a 404 error for method #1 and bad request for method #2. Seeking help to rectify any errors that I might be committing. PFB the details.
Method 1: Followed the method prescribed in this community post
https://community.appsheet.com/t/how-do-i-open-a-file-created-in-workflow/30630/4
Created a file type column in the table -In the workflow that creates a pdf, setting the value of file column to : /data/PurchaseOrders/2nd_Apr_202100:50:51 @ 267583bf.pdf
data/PurchaseOrders - relative folder path of generated pdf doc.
2nd_Apr_202100:50:51 @ 267583bf - file name set in create doc task of workflow (used the expression suggested in the post and disabled timestamp)
Later, added an action (external action: to open a file) and set file to [file name]. However, i get a 404 error on clicking the action button
Method 2: Followed the method prescribed by Aleksi in this community post
[What is the best way to retrieve and view files in app that are generated from templates?](https://community.appsheet.com/t/what-is-the-best-way-to-retrieve-and-view-files-in-app-that-are-generated-from-templates/13284/9) Questions
Yes, thanks! For the very reason you mentioned, I have opted to go with Date and Time stamps. I cannot use the Date() function directly since it contains “/” and that generates file paths I don’t want. It seems I need to use Year(), Month(), Day() function in a concatenate function. Is there a cleaner way to get the date in the YYYYMMDD format? On a side note… It seems like there is not a way in an email workflow to re-attach an already generated file. I mean to pick up a file that ha…
Created a File URl type column in the table and used the below formula for setting the URl - CONCATENATE(“https://www.appsheet.com/template/gettablefileurl?appName=“,“Omxxxxxxx-2559xxx-21-02-23-2”,”&tableName=","Purchase requisition”,“&fileName=”,[File name]). [file name] - /data/PurchaseOrders/2nd_Apr_202100:50:51 @ 267583bf.pdf
also tried this formula for URL column -CONCATENATE(“https://www.appsheet.com/template/gettablefileurl?appName=“,“Omxxxxxxx-2559xxx-21-02-23-2”,”&tableName=","Purchase requisition”,“&fileName=”,encodeurl[File name])
For both URL formulas, I’m getting a “bad request” on clicking the URL in the app.
Would really appreciate if someone can point out the mistake. I have dedicated hours to rectify it myself but to no effect.
Thanks in advance!