Cannot open external file with error "Probable cause: N/A"

Hello,

I generated PDF files and stored in Google Drive successfully after clicking save button in Appsheet form. However I cannot open PDF file via Appsheet.

Below is my Google sheet - Table "B": [idB], [StatusB] & [Input Date] need to be mannually inputed in Appsheet.  [InvoiceURL] generated by Automation bot while clicking save button.

LawrenceMa_0-1665214876702.png

Below is the Google Drive generated PDF files by Automation bot:

LawrenceMa_1-1665215146024.png

Below is the Automation bot settings:

The formula of [InvoiceURL] as below:

concatenate("/appsheet/data/LookupTest-3670637/Files/","IdNumber-",[idB],".pdf")

LawrenceMa_2-1665215218201.png

Below is the Actions setting:

LawrenceMa_3-1665215360670.png

Below is my Appsheet prodution screenshot:

LawrenceMa_4-1665215559378.png

Below is my Appsheet prodution screenshot after clicking the first [idB]: (Everything is fine so far)

LawrenceMa_5-1665215647738.png

Below is when I clicked Invoice button, it prompts error message:

LawrenceMa_6-1665215744708.png

I disable Security, Option, Require Image and File URL Signing, but it still doesn't work at all. How can I click the invoice button and open the PDF which is well-stored in Google Drive? Thanks

 @Steve @WillowMobileSys @SkrOYC @Suvrutt_Gurjar @dbaum 

 

Solved Solved
0 2 731
1 ACCEPTED SOLUTION

In your post, you are showing the actual generated PDF Files.  What is that folder path you are finding them in?

When AppSheet read/writes files, it uses relative pathing based on the location of your datasource sheet.  

The DEFAULT behavior when generating a PDF, is to give the automation File property simply the file name with no path information - e.g. "IdNumber-2.pdf".  The automation will automatically insert the file into a "Files" folder.  That "Files" folder will be inserted at the location where the datasource sheet is located

To retrieve that generated PDF, the File column in the AppSheet table needs the relative path.  In the default case, it will always be the "Files" folder + "/" + the filename.

So, I recommend these three things:

1) In the automation, use this for the file name:

concatenate("IdNumber-",[idB],".pdf")

OR

"IdNumber-" & [idB] & ".pdf"

2)  change [FileURL] to be this expression:

concatenate("Files/","IdNumber-",[idB],".pdf")

OR

"Files/" & "IdNumber-" & [idB] & ".pdf"

3) For existing files, you will need to manually update the FileURL column to match the above AND move the GDrive files to a "Files" folder where your sheet is located so that ALL rows can properly retrieve the PDF files.

PRO TIP!  

AppSheet has a feature to add a GDrive folder as a table source in the app.  This will provide you a single table to see ALL files to which you can add Virtual Columns.  By naming the files appropriately, you can then identify and associate, through the Virtual Columns, a LIST of files to table row. 

For example, if you have an Orders table for which you are generating Invoices,  you could include in the filename the order #.  In the Files table add a Virtual column that extracts that Order # proving a way to link.   Now you can build a list of Invoice files and attach them to the proper Order row.

View solution in original post

2 REPLIES 2

In your post, you are showing the actual generated PDF Files.  What is that folder path you are finding them in?

When AppSheet read/writes files, it uses relative pathing based on the location of your datasource sheet.  

The DEFAULT behavior when generating a PDF, is to give the automation File property simply the file name with no path information - e.g. "IdNumber-2.pdf".  The automation will automatically insert the file into a "Files" folder.  That "Files" folder will be inserted at the location where the datasource sheet is located

To retrieve that generated PDF, the File column in the AppSheet table needs the relative path.  In the default case, it will always be the "Files" folder + "/" + the filename.

So, I recommend these three things:

1) In the automation, use this for the file name:

concatenate("IdNumber-",[idB],".pdf")

OR

"IdNumber-" & [idB] & ".pdf"

2)  change [FileURL] to be this expression:

concatenate("Files/","IdNumber-",[idB],".pdf")

OR

"Files/" & "IdNumber-" & [idB] & ".pdf"

3) For existing files, you will need to manually update the FileURL column to match the above AND move the GDrive files to a "Files" folder where your sheet is located so that ALL rows can properly retrieve the PDF files.

PRO TIP!  

AppSheet has a feature to add a GDrive folder as a table source in the app.  This will provide you a single table to see ALL files to which you can add Virtual Columns.  By naming the files appropriately, you can then identify and associate, through the Virtual Columns, a LIST of files to table row. 

For example, if you have an Orders table for which you are generating Invoices,  you could include in the filename the order #.  In the Files table add a Virtual column that extracts that Order # proving a way to link.   Now you can build a list of Invoice files and attach them to the proper Order row.

Dear WillowMobileSys,

Many thanks, you saved me a day!

 

Top Labels in this Space