Survey 123 Report Template Error: Failed to parse/does not exist or cannot be found in current parsing scope.

24983
47
03-01-2019 03:47 PM
ChrisShuck
Occasional Contributor

I am trying to upload a report template to Survey123 however I keep getting the error  Failed to parse "${MT_Amount1} Field "${MT_Amount1}" does not exist or cannot be found in current parsing scope. 

I have checked the XLS spreadsheet in Connect to make sure that the tag matched exactly, and to my knowledge the opening and closing tags for the repeat is placed correctly as well

Is there an update that could be causing this? It was working fine a few weeks ago with the same tags and the same survey. 

0 Kudos
47 Replies
ZachPearo
Emerging Contributor

Hi Mike, 

I just created a new survey recently and am able to access information outside of the repeat.  Download my form and template that I previously posted above and see if that helps. I made a little mistake, simply missing one letter in a header on the 2nd page.  

0 Kudos
by Anonymous User
Not applicable

Hey Zach,

Within my custom report the field is pulling fine when it is not within the repeat, but once it is located inside of the repeat, then it bombs out.

Outside repeat

Inside repeat

James/Brandon, could you give me a little more insight on this referencing of the parent field into the repeat? My parent is named "Acoustic_Bat_Detector" and the field that I want to call into the repeat is "DetectorID".

I have tried without any luck?

${#BatDtctrInfo} Acoustic_Bat_Detector.${DetectorID}

${#BatDtctrInfo} <Acoustic_Bat_Detector>.${DetectorID}

${#BatDtctrInfo} Acoustic_Bat_Detector.${DetectorID}

Thank you in advance,

Mike

0 Kudos
ZachPearo
Emerging Contributor

Is DectectorID spelled exactly the same as it is in your Excel form?  It also has to be after the repeat in the form table and before the end repeat.  Also ensure in your custom report that your beginning repeat has a "#" example ${#repeatstart} and ends like this ${/repeatstart}  Even though the repeat start and end may be different in your table, it is actually just the repeatstart that you'll use in the form, both to begin and end.

The other obscure thing that I ran into that was causing this error was my table in the custom report.  I had the table properties set to either behind or in front of the text, but the table properties must be text wrapping around. 

This is all I got, hope you figure it out soon. 

0 Kudos
by Anonymous User
Not applicable

Hey Zach,

I appreciate the feedback and I have also checked that with the following being placed within the end of the repeat. "${/BatDtctrInfo}".

Eventually, I will get this going...

0 Kudos
BrandonArmstrong
Esri Regular Contributor

Hi Mike,

 

How many repeat sections deep is the ${DetectorID}?

 

If it is just in a singular repeat (not nested) you should be able to use the following…

 

${#repeat1} ${mainLayer.field1} ${/repeat1}

 

Please try this out and let us know your results.

by Anonymous User
Not applicable

Hello Brandon,

It is just one repeat deep directly off of the parent, but I am curious for what I would need to use for a two deep or nested repeat?

I used the coding mentioned above and it worked perfectly, so thank you for the response and information.

Thank you,

Mike

0 Kudos
ZhifangWang
Esri Regular Contributor

Hi Mike,

For example, you have the following survey schema,

mainLayer
  |--repeat1
    |--repeat2
      |--repeat3

you can use the ${layerName.fieldName} syntax to access questions in parent layers. Note: you have to traverse each parent repeat before opening a child repeat, otherwise, the current parsing scope does not know which repeat instance to be used as the context.

${#repeat1}
${#repeat2}
${#repeat3}
${field1InRepeat3}, ${repeat2.field1}, ${repeat1.field1}, ${mainLayer.field1}
${/repeat3}
${/repeat2}
${/repeat1}

by Anonymous User
Not applicable

Zhifang/Brandon,

Thank both of you for helping out with the questions as this is both exciting and very helpful for me. I have been overwhelmed with billable projects and have not had a chance to go through my forms...hence me working on a Saturday...

Thank you again as I greatly appreciate the information,

Mike

0 Kudos
LizRobertson
Emerging Contributor

Hello,

I'm experiencing this error now, even though this survey was created in June after this bug was apparently fixed based on what I've read above.

I went in to add a choice to a different question than the one that is producing the error; so no changes were made to the question that seems to be the issue.  Since the error does not allow me to publish, I cannot view the schema to see if there is an issue there with a duplicate value.

Please see screenshot, and please advise on how to resolve this issue.  I logged out and logged back in, and waited a few days to see if the bug resolved itself; but it has not.


Thank you,

Liz

Screenshot of error on survey edit page

0 Kudos
JamesTedrick
Esri Esteemed Contributor

Hi Liz,

First could I ask you to clear your browser cache and attempt to publish again?

If you still see this issue, could you try the 'Save As' option to make a copy of the survey and try to publish that?

0 Kudos