Select to view content in your preferred language

Survey123 Report Template Error

8797
15
Jump to solution
04-30-2021 04:12 PM
ElizabethHovsepian
Regular Contributor

I am trying to create a report that will put the repeats in a table row by row (this works fine), but then I want to place the pictures that are taken within the repeats at the end of the table.  I think I am following the syntax examples correctly.  When I try to load the report template with the photos portion, it gives me an error ‘Failed to parse ${photos} since field name or parameter photos cannot be found in the current parsing scope’.

When I do it without the photos portion, it works fine.  Probably a syntax problem but I cannot figure it out.  I have attached some screen shots and the xlsx form and report template.

Using Connect  3.10.323

Thanks, Elizabeth

ElizabethHovsepian_0-1619823858509.png

ElizabethHovsepian_1-1619823914772.png

 

ElizabethHovsepian_2-1619823954696.png

 

 

1 Solution

Accepted Solutions
Jim-Moore
Esri Regular Contributor

Hi @ElizabethHovsepian thanks for providing your XLSForm and report template.

The photos question is inside the tasks repeat, so in the report template this question must be placed inside the repeat's start and end tags (noting that if your repeat is in a table, the start and end tags must be in the first and last cells in the table, respectively).

Please find attached an example report template showing a couple of options:

  1. The photos question included in the table with the other repeat questions, so that you'll get each repeat record and its photos in pairs of rows. Note the two closing tags ${/} - one for the repeat, the other for the multiline image question.
  2. A second repeat section that shows the photos question only - this will output all photos submitted across all repeat records. 

For more information, please see the section on repeats in the Report templates documentation.

Hope this helps. Best, Jim

View solution in original post

15 Replies
Jim-Moore
Esri Regular Contributor

Hi @ElizabethHovsepian thanks for providing your XLSForm and report template.

The photos question is inside the tasks repeat, so in the report template this question must be placed inside the repeat's start and end tags (noting that if your repeat is in a table, the start and end tags must be in the first and last cells in the table, respectively).

Please find attached an example report template showing a couple of options:

  1. The photos question included in the table with the other repeat questions, so that you'll get each repeat record and its photos in pairs of rows. Note the two closing tags ${/} - one for the repeat, the other for the multiline image question.
  2. A second repeat section that shows the photos question only - this will output all photos submitted across all repeat records. 

For more information, please see the section on repeats in the Report templates documentation.

Hope this helps. Best, Jim

ElizabethHovsepian
Regular Contributor

Thank you, Jim.  I got it to work as needed. Thanks for giving me the example for the 2nd type. 

Elizabeth

AirX
by
Emerging Contributor

Hello, @Jim-Moore. I'm hoping to piggyback off this thread. We have a survey and report template that we are trying to update using repeats. Our current survey for capturing found utilities uses multiple groups of questions if more than one utility is found then we have separate templates for findings I.E. (1 utility, 2 utilities, 3 utilities, etc.) I hope to simplify this using repeats and having our report template output our findings dynamically EX. having PG1 of our template add another page(s) if multiple utilities are encountered instead of using multiple templates for more than one utility.

0 Kudos
Jim-Moore
Esri Regular Contributor

Hi @AirX 

You can display each repeat record on a new page by adding a page break inside the repeat block. For example:

 

${#my_repeat}

${first_question_in_repeat}

${second_question_in_repeat}

...etc...

${last_question_in_repeat} <Page break goes here>

${/} <Repeat's closing tag will be on the first line of the next page of the template>

 

Hope this helps. Best, Jim

cc: @RuthJiatengXu 

AirX
by
Emerging Contributor

Jim, 

Thanks for your response I got that info entered but seem to be encountering some parsing errors with questions not located within the repeats.

 

AirX_0-1736532914301.png

 

0 Kudos
Ruth_JiatengXu
Esri Contributor

Hi @AirX ,

I have checked your template, please try making the following changes to your template:

  1. In the "Utility Owner" cell, the ${#individual_entry} tag is not closed. Therefore, the report service considered the content afterward still within the repeat. 
    • Ruth_JiatengXu_0-1736867464283.png
  2. There is an extra close tag here
    • Ruth_JiatengXu_2-1736867771799.png

       

With the updated template, you will generate a report like this:

Ruth_JiatengXu_3-1736868843935.png

Thanks,

Ruth

cc @Jim-Moore 

0 Kudos
AirX
by
Emerging Contributor

HI @Ruth_JiatengXu, thanks for the response! I am receiving an error trying to generate the report with those changes.

AirX_0-1736871564870.png

AirX_1-1736871657999.png

 

 

Thanks,

KP

 

0 Kudos
Ruth_JiatengXu
Esri Contributor

Hi @AirX 

You need to remove the ${/} mentioned in point 2. Please check the template I modified.

Thanks,

Ruth

0 Kudos
AirX
by
Emerging Contributor

@Ruth_JiatengXu,

I appreciate your time and patience.

I did remove as mentioned in #2, that was the error received and with your modified templates well.

0 Kudos