Created Attachment file need in record

I am having a invoice application ,I am having a file column with column type File
I am creating a attachment file and saving in drive with default location
I need open that file when i click the file column in application
Suggest any formula for file column way to achieve

1 Like

Hi @G_S

Here is the answer

[Get URL of workflow generated file](https://community.appsheet.com/t/get-url-of-workflow-generated-file/26607/2) Questions

Hi Jason, give this a try and let me know if it works. Add a file column to your table Make sure you use a formula to set the filename in the “Save File” workflow. Create an action (call it “set filepath”) that sets the value of the file column using the same formula as the “Save File” action. Add the “set filepath” action as an additional step in your workflow after the “save file” step Create another action called “open file” with a condition to only be visible when “filepath” is not blank. …

This, in addition:

[How do I open a file created in workflow?](https://community.appsheet.com/t/how-do-i-open-a-file-created-in-workflow/30630) Questions

Hi, I’m creating an application to generate PDF files. I would like these files to be able to be opened directly in the application, e.g. in Case details or using an action. I followed the instructions I found on the AppSheet Community forum: Get URL of workflow generated file, but I am still unable to open the file (appears standard error: 404 - File or directory not found.). I would like to make sure that I understand everything correctly: I want to create a file in the standard path (appshee…

Enjoy ! Let us know if you are having trouble following these steps

2 Likes

For File column
what formula should i need to use?
what path should I need to set ?
Can you please suggest.

File column, type : File
value is set in the workflow as described in the first link.
Expression can be, for example :
"Invoice" & NOW()

I am get 404 - File or directory not found.

I am using formula for file is
concatenate(“/appsheet/data/App ID/Attachments/”,[ID]“.pdf”)

In workflow create file PDF
File folder path i am using the same formula and Prefix as ID column.

1 Like

I think the situation you described is in the following post from the same thread.

[Get URL of workflow generated file](https://community.appsheet.com/t/get-url-of-workflow-generated-file/26607/4) Questions

do you have the file being saved to a custom path or is it just going to the app default path? The formula you have above should look like this: “appsheet/data/”&[InspectionID]&“.pdf” you can also use the concatenante function: concatenate(“appsheet/data/”, [InspectionID],“.pdf”) If you are using the default folder for the app you should just need this: [InspectionID]&“.pdf”

I took a piece of time to describe what I made myself, I hope that will help you.
I went further in the expression to fulfill my purpose, but that does the job:

  1. create action:

    With expression:

> "/appsheet/data/yourAppFolder/Files/" & NOW() & ".pdf"> > 1. create Workflow, with Workflow rule:
> AND(> [_THISROW_BEFORE].[GeneratePDF_Trigger]<>[_THISROW_AFTER].[GeneratePDF_Trigger],> [_THISROW_AFTER].[GeneratePDF_Trigger]=false> )> > 1. Create task “Task_Write_FileName” (don’t pay attention to what I wrote myself )

  1. Create Task “Task_GenerateFile” (again, don’t pay attention to what I wrote myself )

    Use this expression in the fileName Prefix

> SUBSTITUTE(> SUBSTITUTE(> [fileColumn],> "/appsheet/data/yourAppFolder/Files/",> "/",> ),> ".pdf",> ""> )> >

Please remember to disable TimeStamp, as you set it before in the FileName with Task1_WriteFileName.

If that do not work with just following my steps, please pay attention to expression because I simplified it for demonstration purpose, I may have made a mistake.

1 Like

Still i am getting error 404 ,any other way to obtain this.
Just i need to open that file which we create in workflow in app.

Hi @G_S

I don’t know which further information provide or ask.
Maybe @Rich will have a better lead to explore ?

I tried above steps but i cant get the correct file ,its showing Same 404 error

1 Like

I got that
That’s why I poked @Rich who is, I presume, much more experienced than I am.

1 Like

Hi @G_S

Just got an idea:
can you click on the Test button and check if the path calculated with the formula match with path expected like if you would go by yourself to pick the file in your Drive subfolders ?

1 Like