Action - Open a file

Hello, Appsheet community,
I have created an action to download a PDF file created and stored on Google Drive. Although the file location matches the path I constructed by a formula that is called when the action is triggered, I just get a blank page on the browser with a message “bad request”,
Has anyone experienced and solved this error who I can get some advice from,
Thank you so much,

0 6 2,021
6 REPLIES 6

@WillowMobileSystems
Didn’t I just see you posting some links for good info about this sort of thing the other day?

By the way, this post should be in the Questions category, not Feature Requests.

Thank you @Marc_Dillon , this is the first time I use this interaction place :-), and enjoying doing some tools in AppSheet but I encountered this error. My app is looking good so far I got to be able to generate PDFs, but I don’t know how to solve the “bad request” error to download my pdfs, any idea is well appreciated,
Thanks,

“Bad request” implies there was something wrong in the ATTEMPT to access the file - i.e. you are getting an error before the app even tries to access the file.

Can you post the exact error message and provide an image that shows how you are trying to access the file?

Thank John,
This is the route of my pdf file,
3X_9_3_93a65e5a4448c02dc1f33cc47d069d0b66afec59.png
This is the column in my table that contains the route,
3X_2_d_2dbcb15a676612b86f7b3f66a58c4862ff48745a.png
Then I execute this action,


and then, this is the error I get,

I don’t know what might be causing that error. But here are some things to look at:

  1. Can you open the PDF file directly from the source?

  2. Is it actually a PDF file and not some other file type renamed to a PDF?

  3. AppSheet uses the location of your datasource sheet as the root location for files and images. Based on your pathing info your sheet MUST be located in the “Mi unidad” folder. Is your sheet located there?

  4. How is the action being executed? A button or through automation? Could there be an attempt to open the file BEFORE it is fully written to its location?

  5. How are you getting the file into the app? Are you generating the PDF or uploading it?

A couple of additional things:

  1. When you create File column, the system automatically creates an Open File action so you don’t need to create your own. It may be hidden. You would need to “Show System Actions” by tapping the button at the very bottom of the Actions list.

System ACtion to Open File

In Table and Detail views, the system Open File action is automatically shown as indicated in the images below

  1. If all else fails to reveal the issue and everything seems to be correct, then I would suggest clearing the browser cache and trying again. Maybe in your attempts to get things working something has been saved in the cache that is interfering with the opening of the file