Select to view content in your preferred language

Repeat Groups with Conditionals in Survey123 Report Not Working

19487
28
Jump to solution
11-04-2020 06:08 PM
MichelleTanner
Regular Contributor

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
1 Solution

Accepted Solutions
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

View solution in original post

0 Kudos
28 Replies
BarbaraWebster1
Esri Regular Contributor

Hi Michelle,

Have you tried ${if (sc1 | getValue:"count")>=0} instead of ${if sc1}? See the Report Template Documentation for more information regarding this method.

This is the recommended method for hiding an empty repeat. We will update the feature report documentation to reflect this.

Thanks,
-Barbara

0 Kudos
MichelleTanner
Regular Contributor

Thanks, Barbara. Using that syntax still produces an error for me:

Error: An error occurred when checking the report template. Failed to parse ${if (sc1 | getValue:"count")>=0}. The field name or parameters cannot be found in the current parsing scope.

0 Kudos
BarbaraWebster1
Esri Regular Contributor

In the screen cap of your XLS form, it looks like the repeat name is capitalized while the repeat name in the feature report is lowercase. Repeat names in feature reports are case sensitive so that might be what's causing the error. 

-Barbara

MichelleTanner
Regular Contributor

Barbara,

I've updated the values to caps, but it looks like it is still finding an error:

Error: An error occurred when checking the report template. Failed to parse ${SC1_ft}. The field name or parameters cannot be found in the current parsing scope.

0 Kudos
BarbaraWebster1
Esri Regular Contributor

Does your report template still include ${#SC1} ${/} placeholders to start and end the repeat? Those placeholders would still be necessary in addition to the if statement.

0 Kudos
MichelleTanner
Regular Contributor

Ah, okay. I didn't know it needed to include both placeholders.

Now that I've included both placeholders, it passes the validation. But when I try to run a sample report, it comes up with a generic "error" (below)

Is this syntax correct?:

${#SC1} ${if (SC1 | getValue:"count")>=0}Drainage inlet protection

  • Type ${SC1_ft}
  • Location ${SC1_l}
  • Findings(s) ${SC1_f}
  • Notes ${SC1_n}
  • Photos ${SC1_p1 | size:375:0:0:600}${/}${/}

0 Kudos
BarbaraWebster1
Esri Regular Contributor

It's hard to say what what's causing the problem based on that error message. If you are willing to send your XLS form and report template, I could look into it and see if I can narrow down the problem. 

0 Kudos
MichelleTanner
Regular Contributor

Thank you, absolutely! I've just updated my question to include two attachments - the word template and the xls form. please let me know if you need anything else. 

0 Kudos
MichelleTanner
Regular Contributor

Any luck figuring out that error?

0 Kudos