SURVEY123 REPORT ENGINE ERROR

533
7
10-18-2019 12:56 PM
JAVIERVARA_SANZ
Occasional Contributor II

I'm trying to run reports from a custom template, but keep getting errors for every field I reference.

Error occurred when rendering by the report engine. Failed to parse ${2020_Prescribed_Fire_Grant_Application_MASTER.Grants}.

Please advise.

Tags (1)
0 Kudos
7 Replies
ZhifangWang
Esri Regular Contributor

Hi JAVIER VARA SANZ‌,

Seems the report engine cannot parse the placeholder 2020_Prescribed_Fire_Grant_Application_MASTER.Grants as a valid field name or a field name from a parent layer. 

Would you please confirm which is your case regarding the field name in the database?

  1. Is 2020_Prescribed_Fire_Grant_Application_MASTER.Grants is a whole field name that contains period (.) inside the name?
  2. Or 2020_Prescribed_Fire_Grant_Application_MASTER is a layer name while only Grants is a field name?

Currently, the report engine doesn't support field name which contains a preriod (.) in it. 

In addition, it will be helpful if it's possible to share the original XLSForm and report template file for us to investigate/confirm the issue.

Thanks,

Zhifang

0 Kudos
JAVIERVARA_SANZ
Occasional Contributor II

Thanks Zhifang.

To answer your question, 2020_Prescribed_Fire_Grant_Application_MASTER is a layer name while only Grants is a field name.

However, I believe the issue is related with the name of the layer itself starting with a number, since, although the actual name in the survey is 2020_Prescribed_Fire_Grant_Application_MASTER, it has been saved in AGOL as _2020_Prescribed_Fire_Grant_Application_MASTER.

As a workaround I've done the following:

  1. Export the layer to my computer
  2. Rename the feature class to (Prescribed_Fire_GRANT_2020_Application_MASTER) , the relationship class (Prescribed_Fire_Grant_2020_Application_MASTER__ATTACHREL), and the attachments table (Prescribed_Fire_Grant_2020_Application_MASTER__ATTACH)
  3. ZIP the resulting geodatabase and upload it back to AGOL to create an independent hosted feature layer (Prescribed_Fire_Grant_2020_Application_REPORT)
  4. Create a copy of the Survey and name it Prescribed_Fire_Grant_2020_Application_REPORT
  5. Update the XLXS form to add a submission URL that points to the new hosted feature layer

At this point I'm able to generate the report without any issues. I can't really wait for this to be resolved, so I'm glad the steps mentioned above have worked so far. I'm not sure about the attachments though, so we'll see. The bad news is that the layer will no longer be connected to the original data source. This is not important in my case, but definitely a minus.

Taking all my feedback above, could you confirm it the fact the the service was created where the name starts with a number might be the origin of the issue. If affirmative, it would be good to either allow it in the future, or make sure Survey123 Connect prevents users from creating reports under this circumstances.

Thanks a lot for getting back with me.

Javier

0 Kudos
ZhifangWang
Esri Regular Contributor

Hi Javier,

Thank you for the detailed information and also sharing the workaround which may help others.

I can reproduce the issue by creating a simple survey whose name starts with a number and also contains a repeat from Survey123 Connect, then try to reference a field in the parent layer by using the survey name inside the repeat section in the report template. So for your question, yes, I can confirm that the issue is caused by the additional underscore in the behind layer name which is not the same as the survey name.

In addition to your workaround above, could you try to simply add an underscore in the main layer name in your original template to see if it works for you? For example, instead of using ${2020_Prescribed_Fire_Grant_Application_MASTER.Grants}, use ${_2020_Prescribed_Fire_Grant_Application_MASTER.Grants} to access the field in the parent layer inside a repeat section.

The report engine is designed for being able to work with a feature service directly (even without a survey), so using the correct layer name should work. 

Please let me know if it does not work for you.

Thanks,

Zhifang

0 Kudos
JAVIERVARA_SANZ
Occasional Contributor II

Thanks for the prompt response Zhifang.

I understand the workflow you are suggesting, but my word document is simply referencing ${Grants}. Please confirm it will be OK replacing it with ${_2020_Prescribed_Fire_Grant_Application_MASTER.Grants}. If that is the case, I'll give it a try.

Also FYI, I'm not using repeats in this survey, and producing the reports directly off Survey123.com, although my step is to generate them through the API.

Thanks again.

Javier

0 Kudos
ZhifangWang
Esri Regular Contributor

Hi Javier,

Can you please confirm that it's only the field name ${Grants} in your report template and your didn't reference it by layer name while error message returned by the report engine includes the layer name before the field name as ${2020_Prescribed_Fire_Grant_Application_MASTER.Grants} ?

If this is true, would you mind sharing some detailed steps to reproduce the issue? I've tried the following steps but there is no error during the syntax checking or generation of the report.

1. Create a new survey in Survey123 Connect which name starts with a number. For example, "2020_startWithNumber".

2. Leave the only text question "example" in the XLSForm untouched and publish the survey.

  * I can observe that the underlying feature layer name is "_2020_startWithNumber".

3. Submit a record in either the web app or the field app.

4. Try to generate a feature report by using the default sample report template, which contains the placeholder "${example}".

Reproduce steps would help us a lot to investigate the issue.

Thanks,

Zhifang

0 Kudos
NationalTobaccoAdministration
New Contributor

Hello! Until today this thread is very helpful. I got the same  error, and I figured out that the survey layer name starts with number. What I have done to correct is: 

1. I logged in to my dashboard>content>survey form folder

2. Open the feature class (hosted)

3. I change the name of my point layer from "1" to "mobile_monitoring_form"

4. It works! 

 

Thank you very much. You guys save my life!

0 Kudos
MarceloCatalão
New Contributor III

hello, I've also been having this problem, although it solves the situation of the reports, then it creates problems in sending new reports, because it doesn't recognize the layer

thanks

0 Kudos