Generate a document with start expression with many tables

Hi there,

I am trying to generate a PDF report based on the information entered in my form.
I have several tables:
[Inspection]
[Sheet]
[Fault list]

[Inspection] can have multiple [Sheets] and [Sheet] can have multiple [List of Defects].

In my report I left the Inspection page to have access to certain data and I would like to have access to certain data of the sheet [List of defects]. Currently I don't know how to use "Start expression" to access it, can you help me?

Solved Solved
1 12 408
1 ACCEPTED SOLUTION

Finally I found the solution! This is what my document looks like:

Laurine_0-1661142378917.png

 

View solution in original post

12 REPLIES 12

Just in case you have not yet taken a look at the below article, it explains the template start expressions well.

Use Start expressions in templates - AppSheet Help

 

Yes I have already read the article but I cannot apply it to my case.

Everything is going well to retrieve the information from my [Sheet] sheet, but to retrieve that from the [List of defects] sheet, I can't.

Thank you. You may want to share your template expressions and details such as if the mentioned tables are referenced to each other.

Here, it's my document with my expressions 

Laurine_0-1660807988055.png

And I have this error

Laurine_1-1660808033170.png

 

Thank you. Are the tables "Liste...." and "Feuille" referenced to each other and if so in what way?

Yes, [Feuille] can have many [Liste dรฉfauts].

Laurine_0-1660811262252.png

 

Thank you.

Wow! That is a bit complex template.

I believe probably the error is because the template does not know the relation between two tables as you might have set the automation bot on table "Feuille". Is this understanding right that bot is set on table "Feuille"?

So probably the expression, highlighted in red in the image below is unrecognized by the automation .

Typically the records from a related table should be denoted by

<<[Related Liste dรฉfauts]>> in place of << START: Liste dรฉfauts[[ID dรฉfauts ] >>

Also the first <<START>> expression on table "Feuille" , highlighted in blue is terminated with <<END>> before the second << START>> expression on Liste dรฉfauts ( Highlighted in red) starts.

I think because of these two reasons there are errors.

Report Template.png

You may want to state in detail what you are trying to accomplish in the second table so that we may see if there are feasible solutions. Any specific reason the second table on the right is separately included  even though most columns are still from table "Feuille" as in table 1 on the left? 

Thanks.

I set the automation on the sheet [Inspection] because it is on this table that I want to collect the most data.

My report consists of several parts:
In the first part I just enter all the information relating to the inspection.

Then in the second part of the document (as in the image sent previously) I come to make an inventory of all the defects found on each sheet.
In the first part of the table I come to check the different mechanical properties.
In the second part of the table, I list the faults that have been analysed. Each defect has a number of points allocated and I come to count this number of points in the rest of the table then determine if the sheet is accepted or rejected.
If I simplify my tables to explain my tables are organized this way:

INSPECTION

NameTypeKey Formula
Inspection IDTextyesUNIQUEID()
............
Related SheetListNoREF_ROW("Sheet","NยฐInspection")

SHEET

NameTypeKey Formula
Sheet IDTextyesUNIQUEID()
Nยฐ InspectionRefNo 
............
Related List defectListNoREF_ROW("List defect","NยฐSheet")

LIST DEFECT

NameTypeKey Formula
List defect IDTextyesUNIQUEID()
Nยฐ SheetRefNo 
............

They overlap one after the other.

Thank you for more details.

Based on the information you have shared, you could try below.

1. In the first table , please try an expression

 <<START : [Related Sheet]>> in place of <<START : Sheet[ Key ID]>> <<END>>

2.  In the second table in the first column "List of Defects"  and the second column "Sum of the points" , please try expressions as mentioned below by removing existing expressions.

List of DefectsSum of the points

<<START : [Related Sheet]>>

        <<[Related List defect]>>

 

Remove the start expression

<<[TT Points Feuille]>>

Other columns can remain as it is. As I mentioned, it is difficult to know entirely what contents you are looking for in the report. So based on understanding, the response may be iterative.

Also AppSheet template expressions, table formatting works in certain way. So the table placement may also need change if the template does not support side by side two tables.

 

Finally I found the solution! This is what my document looks like:

Laurine_0-1661142378917.png

 

Thank you for the update. Nice to know you finetuned the suggestion and got it working.

For any future readers of this thread, the following was core issue: 

The main issue was the BOT was defined on table Inspection and then the template expressions were set on other (child) tables without a direct link in those expressions to the Inspection table. So the bot was not recognizing those expressions and the app editor was displaying errors. Therefore suggested the use of reverse reference columns  ([Related ..] ),  in template expressions that established a direct link with the Inspections table. The second template table required more finetuning in addition to suggestion as it was a grandchild of Inspections table.

Hi, 

Please check the below link, I think it could help you.
https://support.google.com/appsheet/answer/11541779?hl=en

Top Labels in this Space