Create a new file with child records

Hi guys

I have an app that creates pdfs of orders and contains child records. However, sometimes the child records are not recorded on the pdf.
On the template I use a Start End Expression.

<Start:Related_Entry><<[Description]>><<[Quantity (kg or l)]>> <>

Because the pdf is sometimes displayed correctly, the template should be correct. What could be the cause of the problem

Thanks Roland

Please take a look at the following 2 help articles

Section " Why is the parent record displayed but the child records are missing?" in the help article below

Troubleshoot email - AppSheet Help

Section " Send an email only after adding a parent record and all of its child records" in the help article below

Send an email from an automation - AppSheet Help

Thank you so much. It works :grin:

Thank you for the update. Great to know the suggested articles were useful to you.

From the 2nd link :

How does this ensures all child records has been added ? Still I could not get the logic.

Do this as follows:

  1. The child table must contain a Ref field to the parent table. Enable the Is a part of? property of the Ref field. This makes it possible to add child records when the parent record is added.

  2. Add a Text field to the parent table. Call the field Status and set its Initial value property to "" (blank). The Status column controls whether the data change event triggers.

  3. Create a data-change action for the parent table which sets the Status column’s value to "Run".

  4. Create a second data-change action for the parent table which sets the Status column’s value to "" (blank).

  5. Create a composite action for the parent table that invokes the two data-change actions above. This composite action invokes the first data-change action to set the Status column’s value to "Run", and the second data-change action to set the Status column’s value to blank. These two data changes will be sent to the server as separate updates. The first update triggers the automation event, while the second update prevents further updates from triggering the automation event.

  6. Go to the UX > Views tab. Click Show system views. Select the form for the parent table. Expand Behavior. Find Event Actions and set its Form Saved property to the compositive action created in the previous step.

  7. Set your data change event to Updates only. Set its Condition property to: [Status] = "Run"