Action button to create and download PDF & Embed image in email body template for PDF

Hello,

  1. I want to give an action button by clicking it, a user can generate and download PDF. How do I do it?

  2. I have a reference table for company name and its log. On the basis of company code in the transaction, I want to embed company logo image into the email body template for PDF. How do I do it? When I wrote select statement, it did not bring the logo image rather it printed selected column value in the PDF.

Regards,
Rajan

in the workflow template you have to upload a google doc template of the format you want the data to be in along with the company logo.

Then create a action button with option selected to change the value of a certain column…which in turn should trigger the workflow to send email to the preset id.

1 Like

You may want to take a look at the topic Sending Email from an Action Button in the article below

In the workflow pane, you could use action’s reaction as “Save File”

image

Could you please elaborate more?

1 Like

There is a master table “Company” it has company code and a log image columns. Another table as “Transaction” which is Company Code and other columns.

Now, I want to give a button to the user when he/she clicks on that button, it should generate a PDF of the transaction with a company logo on the top of the page. I already use google doc as email body template.

Hope, I am able to explain.

Rajan

Thank you.

I believe, this can be generated with the suggestion of Sending Email from an Action Button on Transactions table.

For company logo not appearing, could you please elaborate the relavant template expression and column types of image columns in both the tables and whether Company table is referenced by the Transactions table.

Hello,

Master table.

Transaction Table.

image

Images stored on drive.

The email body template which is saved as PDF to send as attachment in the email. But it is not embedding image in the PDF. Rather captures column name only.

How to embed logo image into the PDF? So that when user downloads PDF from mail and opens it has company logo image on the top of the page.

Thank you. Can you reference NFA Company table into Credit Note Requests table? In that case you could pull the company logo into template ( or Credit Note Requests table as well ) with a dereference expression like [Company Code].[Logo]

There is no way to do this with one click.

PDF files are generated by workflows or reports. Workflows and reports are performed by AppSheet servers, not by the app itself. Workflows are performed when a sync occurs between the app and the server.

Generated PDF files are saved to the app’s cloud storage. To access the generated PDF file in cloud storage, the app must present and the user must click on a link to the file. I can’t speak from experience, but I believe users must open the PDF then save; I don’t think there’s a way to download directly without first opening.

1 Like

Good catch @Steve, I missed the word “downlaod” and assumed it as “save”( in the drive).

1 Like

Ok. But a PDF can be mailed on some action. In that scenario, how to embed an image a I explained the transaction scenario in earlier post?

If you are unable to reference the Company table, then please try with an expression as below to pull the logo into the template.

<< ANY(SELECT(NFA Company[Logo], [Company Code]=[_THISROW].[Company Code]))>>

1 Like

Hello,

As per your above solution, the image appeared in the email body, but it did not appear in the PDF.

Template is as below.

PDF is as below.

Now, it should appear in the PDF too.

Thanks.

The expression appears to be correct. May be you wish to ensure changes were saved to the template before report was run by running the report once more.

3 Likes

Thanks a ton Suvrutt.

Logo appeared in the PDF too… :grinning: :grinning: :grinning:

Regards,
Rajan

3 Likes

Great. Thank you for the update.

it can be useful, although it is in Spanish