Creating a pdf file using word template

Hello All - I am trying to create a pdf file using a predefined word template. The structure of the data is as follows:

Table A (Company) → Table B (Showroom) → Table C (Customer) → Table D (Site Visit)

I have created a BOT for Add/Updates for Table D for creating a pdf file that I need to share with the customer. In this pdf while I need data from tables A, B, C and D. I have 2 issues as follows:

  1. How can I reference table A (Company) data from table D BOT in the word template for creating pdf file? I tried THISROW-1, THISROW-2 but it doesn’t work.

  2. When I go to Settings → Data —> Relationships, App sheet doesn’t show a link between table B and table C, however in the tables they are linked and in table B, it shows [Related Customers] column too

Thanks in advance!

Hi @JayG

The key-solution is to use dereference expressions:

Dereference expressions - AppSheet Help

Sample email templates - AppSheet Help

Use templates in an automation - AppSheet Help

Also, it all depends against which table you fire your email.

Let’s assume you have this structure:

  1. Table SITE_VISIT, with columns:
  • id, type Text
  • customer, type Ref, source table CUSTOMER
  • information 1, information 2, and so on
  1. Table CUSTOMER, with columns:
  • id, type Text
  • company, type Ref, source table COMPANY
  • information 1, information 2, and so on
  1. Table COMPANY, with columns:
  • id, type Text
  • name, type Name
  • address, type Address
  • information 1, information 2, and so on

And you wish to fire your email an email from the table SITE_VISIT. Then, you could use:

Company: <<[customer].[company].[name]>>

Hi @Aurelien - Thank you very much for your swift reply. All the 3 shared links were of great help!

1 Like

You are welcome!