List all nested (parent/child) rows in document

Hey guys,

I have an App where the user creates an Offer for 1…n Machines. I use a Form view with a nested form to add Machines to the Offer. That works great (data is stored correctly). I have trouble creating a PDF file that contains information about the Offer and a list of all Machines in that offer.

I use a workflow that is triggered when an addition is made to the Offer table. For some reason the child elements are not evaluated correctly. When there are 2 Machines in the Offer there should be two lines in the table in the template. But I get nothing.

My template looks like this:
image

Offer and Machines are linked with a parent/child relation. In the Offer table I have a virutal column Machines:
Formula: REF_ROWS(“Machines”, “Parent”)
Type: List
Element Type: Ref
Referenced Table Name: Machines

In the Machines table there is a column Parent which relates to the offer:
Type: Ref
Source table: Offers (slice)
Is a part of: yes

What am I doing wrong?

See Sending Email Only After Adding a Parent Record and All of Its Children here:

1 Like

Thanks for that link. This article needs a table of contents! :slight_smile:

It kind of works. Only sometimes though o_O I dont know if that is a bug or if im just doing the wrong thing here.

The article wasnt clear which of the hidden views would be the right one. Right now it works after I edit one of the hidden views (called Offers_Form) and save the App. But only for exactly one Offer. Every other Offer that I create does not create a document o_O

In my experiments I create an offer with two children. If I do that after I’ve made any change to the app and saved it the App wants to sync 5 things to the server. In that case the document is created correctly. When I create another Offer after that (with the exact same inputs) the App only wants to sync 3 things and the document is not created.

Whats going on here?

I got it to work. I had to configure the actual view that I’m using in my App to execute the actions in the On Form Saved trigger.

I dont know why that article states that you have to do that in one of the hidden views.