Repeat Groups with Conditionals in Survey123 Report Not Working

15670
28
Jump to solution
11-04-2020 06:08 PM
MichelleTanner
New Contributor III

Hello! I am trying to build a report that displays repeat groups in a report. Not all of these repeat groups are required, so I only want to show which groups have records in the report. 

However, I keep running into the error: An error occurred when checking the report template. Failed to parse ${sc1}. The field name or parameters cannot be found in the current parsing scope.

I am at my witts end. I believe I have the syntax correct and have triple checked everything, but it still will not work!  

Here is an example of the repeat group with conditionals. Ideally I put this in a nicely formatted table, but I am still just trying to figure out the syntax:

repeat group = sc1

each question within the group is then labeled sc1_l, sc1_f, etc.

${#sc1}${if sc1}Drainage Inlet Protection

  • Location ${sc1_l}

  • Type ${sc1_ft}

  • Findings(s) ${sc1_f}

  • Notes ${sc1_n}

  • Photos ${sc1_p1 | size:375:0:0:600}${/}${/sc1}

Am I missing something here?? Thanks.

0 Kudos
28 Replies
BarbaraWebster1
Esri Regular Contributor

It looks like the error you're seeing is a result of a bug in the feature report export process when exporting geopoints with a bind::esri:fieldType of null that are within repeats.

I've logged this as a bug, but if you are looking for a workaround in the meantime you could remove the null field types from all your geopoints that are within repeats. This will mean that feature layers for these points will be generated, but these can be ignored if they are not needed. Hopefully that helps!

-Barbara

0 Kudos
MichelleTanner
New Contributor III

Barbara,

This seemed to solve the issue! The next issue I am seeing now is that I would like to display all photos within a multiline photos question type. Is that possible?

 

0 Kudos
BarbaraWebster1
Esri Regular Contributor

Hi Michelle,

Sorry for the delay in getting back to you, you can use the following syntax for multiline photos:

vertical arrangement:

${#incident_photos}
${$file | size:300:0}
${/}

 

horizontal arrangement:

${#incident_photos}${$file | size:200:0}  ${/}


This blog post discusses using multiline photos in reports. Also note that if you include a space or line break before the closing ${/} tag, that space or line break will show up between each photo in the exported report.

Thanks,
-Barbara

0 Kudos
MichelleTanner
New Contributor III

Thanks Barbara! This notation seems to pass the first go-around of checks for Reports, but when I go to preview sample reports, I just get the generic error message below: 

The task failed because all reports failed to run convertToPdf.

I just attached the sample report that I am trying to run. Do you see any glaring issues with the notation there? 

Thanks!

0 Kudos
BarbaraWebster1
Esri Regular Contributor

Hi Michelle,

The syntax you're using for the multiline photos looks correct. If you attach the most recent version of the xls form, I could look into it a little more and see what might be causing that error message.

Thanks!
-Barbara

0 Kudos
by Anonymous User
Not applicable

Hi Barbara,

were you able to resolve Michelle's problem? I have run into the same issue: when I am trying to generate feature reports, it says: 

The task failed because all reports failed to run convertToPdf.

Sample reports work perfectly right after I generate a sample template for them, however when I use sample templates a couple of hours later after generation, it gives me the same error message.

Would you please have a look at the form and the report template.

Thank you,

0 Kudos
BarbaraWebster1
Esri Regular Contributor

Hi @Anonymous User ,

I published a survey based on the XLS you provided, and I wasn't able to reproduce the error you were seeing when generating a report based on a sample report template (even after waiting a day). However I was able to reproduce the error when I used the report template you provided.

I think the issue has something to do with the if statements that span two cells because removing the two cells within one of the if statements would cause the row to only have two cells while the rest of the table has four cells per row, which Word doesn't allow. 

BarbaraWebster1_0-1629504085246.png


One alternative might be to use an OR (||) operator and apply the if statement to the entire row, so the row will show if one of the two questions had a value. I'm not sure if this would make sense for your report content though. 

BarbaraWebster1_2-1629505393083.png


Best,
-Barbara

0 Kudos
JanellaFlook
New Contributor II

Hello,   I have the same issues,  yesterday evening I uploaded a new template, tested it on my desktop and Ipad and printed serveral sample reports.  This morning I attempted to print a completed new servey and receive a error: " the task failed because all reports failed to run convert to PDF?   Nothing changed from yesterday to this morning.  What causes this error at will?  

Tks for any assistance

0 Kudos
BarbaraWebster1
Esri Regular Contributor

Hi Janella,

One possibility is that if the data in the record you're exporting activates different parts of the report template than were activated during your testing export, you might be running into issues you didn't encounter during testing. If you are able to share your XLSForm and report template, I could see if I can isolate the issue.

Thanks,
-Barbara

0 Kudos
JanellaFlook
New Contributor II

Thanks Barbara,  No sure I completely understand your answer but I have attached the requested forms for you to review.   Thanks for your assistance.... 

0 Kudos