Simplest way to create on-demand report

Hi Guys,

What is the simpliest way to create and download on local desktop a PDF report at row-level. An order for example.

Right now I use a workflow with a Send email or Save file action, looking for adds in a “Request report” table. Request refencing the Order table.

Is there any simplier way ? Dowloading possible ?

Thanks

1 Like

Not directly, no. You have to generate the report with a workflow. You can then provide the user with a link to open the report, but there is no way to generate-and-download.

1 Like

Thanks Steve,

Fair enough. Is there a way to automatically integrate the saved file url within a row ?

I’ve not done it myself, but I suspect it’s just a matter of giving the generated report file a predictable name, then adding a File column to your table that contains that name.

Note that AppSheet caches files, so if the file name is fixed but the content changes, the user will only be able to download the earliest version and won’t see the updates. To allow the user to get updates, the file should be given a different name with each update. By default, AppSheet adds a timestamp to each generated file’s name to accomplish this, but this then means the app won’t know what exact name the file is given. To get around that, disable the automatic timestamp and generate a unique filename yourself so you know exactly what name the file will be given.

Hi Steve,

I think I got the idea.

I did a workflow like :

image

Also a virtual file type column :

image

The file type column seems to ignore the folder path part of the concatenation. I get only th ID part + .pdf. Of course the link does not work.

image

Does it look like a bug to you or did I miss something ?

Thanks

Try removing the folder path entirely in both places until you get the basic function to work.

Tried it !

When I remove the folder path from the workflow, the file goes to the “Files” folder (in the app data folder).

Then if I remove the folder path from the concatenate function, it fails (while it looks to the root I guess).

if I write CONCATENATE(“Files/”,[commande_achat].[ID],".pdf"), it fails too (still ignoring the folder path part.

Hmmm… Time to summon some help!

@Aleksi, HEEEELP!!!

1 Like

In generally…
#1 - Set the folder name in your Workflow rule like “/SubFolderName”. This will create a subfolder under the Appsheet/Data/AppName-123456 folder
#2 - The PDF file prefix could be <<[ID]>>
#3 - Then create a virtual File column with an app formula CONCATENATE(“SubFolderName/”,[ID],".pdf"). This will create a file name to your PDF. In the app it shows it just like “k8HtG6vS.pdf” if that is your ID column’s value.

2 Likes

Hi Aleksi,

I tried exactly what you described. The subfloder “/SubFolderName” is created in the default app folder, not where the spreadsheet is. The report is properly generated. Stil the link made by concatenate function fails.


image
image
image

Sorry… wrongly noted as my spreadsheet was already in the app folder. I updated the original reply.

1 Like

The attachment file name needs to be <<[ID]>>, not just [ID]. That will create a file with a name “[ID].pdf”

1 Like

Like this ?
image
The workflow make app error.

Actually with [ID] alone, the file name looks OK already.
image

I believe it’s not. It’s just updating the already exists [ID].pdf file because you don’t have any timestamp.

I confirm that <<[ID]>> in file prefix in the workflow make app error.

Actually I would prefer let the time stamp but it seems no way to concatenate the system generated timestamp to build the predictive file name.

However, the all point here is that I fail to generate a functional file link with the concatenate expression. The result in the spreadsheet looks OK too.
image

Do you have that [ID] column in your table where you generate that Workflow?

Sure :

Just realized from one of your printscreens that you are actually using “Save file” action rather than “Email”. With the Prefix you need to use “[ID]” instead of “<<[ID]>>” which is little weird that we have different rule for two different actions. I will discuss about that with devs.

3 Likes

What is your default app folder? You can find it from Info > Properties

I have been trying with quotation mark. I got the file name, which is not usefull

image

Here is my default app folder :
image