Email report error: The parent is missing

Hi,

since last 28th of May Iโ€™m experiencing the following error on all email reports from one particular workflow email reports that my app is generating once a certain condition comes true.

This particular workflow email report was doing fine until 27th of May.
No changes were done to the template on that date. The template is still reachable today with no problem.

All other workflow email reports are doing fine.

The error reported on the logging section of the app is as follows:

โ€œErrorโ€: โ€œError: Workflow rule โ€˜rule nameโ€™ Attachment template. Template could not be loaded due to exception: The parent is missing.โ€

No further info is shown, which makes it difficult to debug.

Any idea or changes produced on appsheet which I should take care on my workflow template?

Thanks in advance

0 18 1,143
18 REPLIES 18

Try to remove that template from your Workflow and then bring it back.

Done.
The workflow works well without the template, but the same error appears again once the template is brought back as an attachment.

โ€œErrorsโ€: โ€œError: Workflow rule โ€˜rule nameโ€™ action โ€˜Action 1โ€™ Attachment template. Template could not be loaded due to exception: The parent is missing.โ€

Any recommendation to better understand / debug what the โ€œmissing parentโ€ is?

It sounds it could mean parent record. Do you have child records in this template?

Yes. There are several type of child records:

Related ServiceDays [ServId]
Related ServiceMaterials [ServId]
Related ServicePhotos [ServId]

Note ServId is the ID & key for the parent record

Are you able to share that templateโ€ฆ printscreen would be enough I belive.

starting from top to bottom on the template here you have snapshots of what is included:

Info of the parent record, but also some of related child records:
2X_c_c1da540b071f01e8126263edc06cfcef3c64930c.png

Info of the parent record, and a query to referenced table:
2X_c_ca073b5182733a091fe65a272c13a0d130d393de.png

Child โ€œAโ€ records related to the parent record. Also some count() related to child records:

Child โ€œBโ€ records:
2X_7_7074ac4062d1814b037f37f644934e6685762ab4.png

Footer of the report wit hparent record data (i.e.: [Comments], [Recommendations], etc.) app global variables :

And finally some fotos from the Child โ€œCโ€ records (if included):

At the moment I keep some text that will be latter on modified to become additional fields, but it should not affect for now as all these fields do not have any << >> characters to delimitate the fields:
2X_c_c879ad35c1638038142006a033b2ceba14e44cf1.png

Let me know if you would prefer me to share the template link in private

Those missing <<>> can be the reason. Try to temporarely remove them and then make a new test.

I have removed the unbracketed code, but obtained the same results: no workflow email is generated and the same error

Any further guess on what may cause it to not merge with the template?

@Phil Any thoughts what else the error could indicate?

Hi Oscar,

It may be a change I made. I recently improved the way workflow templates are parsed. It is possible I introduced a problem when doing that.

I can investigate if you provide:

  1. Your account id
  2. The app name
  3. The workflow rule name

Hi Phil
Here you go:

  1. account id: I assume it is 91404?
  2. app name: โ€œService-91404โ€
  3. workflow rule name: โ€œField Service Reportโ€ / โ€œAction Nameโ€: โ€œAction 1โ€

Let me know if you need any additional info

I have been comparing the vector of values indicated in the failed sync and found out the order of some fields in the debug log does not match the order of fields in the table within the Drive spreadsheet and app.

The differences of fields was in the last few values located right before the โ€œRelated fieldsโ€ which are not included in my spreadsheet.
On my spreadsheet and app, the last 12 columns are calculated with a formula in the spreadsheet, which at the time of syncing appear as โ€œ[sync to compute]โ€

Order of fields within the app and spreadsheet:

In the debug log (failed record), the fields are listed as follows (Iโ€™ve only listed starting at the โ€œNumberEditsโ€ till the end):

โ€œ6โ€,
โ€œ[sync to compute]โ€,
โ€œ[sync to compute]โ€,
โ€œ[sync to compute]โ€,
โ€œ[sync to compute]โ€,
โ€œ[sync to compute]โ€,
โ€œ[sync to compute]โ€,
โ€œ[sync to compute]โ€,
โ€œ[sync to compute]โ€,
โ€œ[sync to compute]โ€,
โ€œ[sync to compute]โ€,
โ€œ[sync to compute]โ€,
โ€œaJu3p8s9โ€, (corresponding to the โ€œRelated ServiceDaysโ€)
โ€œโ€, (corresp. to the โ€œRelated ServiceMaterialsโ€)
โ€œ08/01/2019โ€, (corresp. to the โ€œWarranty Endsโ€)
โ€œโ€, (corresp. to the โ€œRelated ServicePhotosโ€)
โ€œ[sync to compute]โ€ (provably corresponding to โ€œTotalPhotosโ€)
]

As you may see, there is one of the 12 computed fields ("[sync to compute]" most provably the โ€œTotalPhotosโ€) which appear on a different position.

I assume it is due to that field has a formula related to the spreadsheet formula as below, related to the ServivePhotos, but not sure:

COUNTIF(ServicePhotos!C[-26]:C[-26],RC[-17])

I have no other ideas where to inspect to any further levelโ€ฆ
Any guess?

Hi Oscar,

I have found two issues that are affecting your attachment template.

The first issue is in the cell containing the following value:

<<CONCATENATE(SELECT(ServiceDays[T.init],
[ServId] = [_THISROW].[ServiceId], TRUE))>>

Please remove the carriage return following the comma that ends the first line and before the start of the second line.

The second issue is a bug in my new template parsing code. It cannot handle the cell in your table that contains a Start and End in the same table cell. To circumvent that, I am going to return your account to use the old template parsing code. That change will take effect when we deploy in the next hour or so. Once that happens, your template should start working again.

Once I have fixed my new template parsing code to handle your table that contains a Start and End in the same table cell, I will return you to the new template parsing code.

Sorry for the problem I caused you.

Hi Phil
It works again now, even without removing the carriage return yet.
Thanks for your great support!

I fixed the underlying problem last night. You will be back on the new template parsing code when we deploy this afternoon. Please fix the carriage return problem before then.

Thanks Phil

I did the change already, so it should be ok once your change is being deployed

Thanks again for your support!

Thanks Oscar.

Top Labels in this Space