Hello All,
First post.
I've got a short survey. Primary question is "Watch Report Item". It is either "Significant Case" or "Patrol Check". I've built a Word Template. I've got a table for Significant Cases and a separate table for Patrol Checks. The tables are within the SUMMARY section. How can I get the top table to just show "Significant Cases" and the bottom table to show just the "Patrol Checks"?
I've tried all of these options:
${watch_report_item | getValue:""}
${if watch_report_item | selected:"Significant_Case"} ... ${/}
${watch_report_item | checked:"Significant_Case"}
but get this error most of the time:
Error: An error occurred when checking the report template. Failed to parse ${if watch_report_item == “Significant_Case”} since field name or parameter watch_report_item cannot be found in the current parsing scope.
I've also tried this "if" statement: ${if watch_report_item == “Significant_Case”}
Here is my current set up within the table:
SIGNIFICANT CASES
${#survey|orderByFields:"case_ DESC"}${watch_report_item} | ${case_}, ${time_of_incident}, ${incident_type}, ${location_checked} ${narrative}${/} |
PATROL CHECKS
${#survey|orderByFields:"case_ DESC"}${watch_report_item} | ${case_}, ${time_of_incident}, ${location_checked}, ${narrative}${/} |
Your help would be greatly appreciated. I've tinkered around with it for hours with no luck. This final "fix" will make my report just what I need.
Thank you,
Lance in California @ Merced Police Department
Solved! Go to Solution.
Hi Lance. I think you may want to use syntax along these lines:
In your case, the expression could look more like:
${#survey | where: "watch_report_item = 'Significant_Case' " | orderByFields:"time_of_incident DESC"}${case_}, ${time_of_incident}, ${incident_type}, ${location_checked} ${narrative}${/}
Also attaching a modified template here for your reference.
It is important that you keep the quotes straight. For example: simple quote: ' and double quote ". Microsoft Word has a tendency to create 'smart quotes' and they generate errors in the Survey123 report engine. Check this: https://support.microsoft.com/en-us/office/smart-quotes-in-word-702fc92e-b723-4e3d-b2cc-71dedaf2f343
It is hard to figure out the exact syntax without the reference help for your survey but I am hoping this gives you some clues. There are some additional details about summary sections in here: https://community.esri.com/t5/arcgis-survey123-blog/survey123-tricks-of-the-trade-summary-sections-i...
Attaching a word template below so you can see the syntax to filter the two types of cases in two separate tables.
The report template syntax is specific to Survey123 reports. It is documented here:
This video could also be handy: https://www.youtube.com/watch?v=a7pABoinPlM
Hi Lance. I think you may want to use syntax along these lines:
In your case, the expression could look more like:
${#survey | where: "watch_report_item = 'Significant_Case' " | orderByFields:"time_of_incident DESC"}${case_}, ${time_of_incident}, ${incident_type}, ${location_checked} ${narrative}${/}
Also attaching a modified template here for your reference.
It is important that you keep the quotes straight. For example: simple quote: ' and double quote ". Microsoft Word has a tendency to create 'smart quotes' and they generate errors in the Survey123 report engine. Check this: https://support.microsoft.com/en-us/office/smart-quotes-in-word-702fc92e-b723-4e3d-b2cc-71dedaf2f343
It is hard to figure out the exact syntax without the reference help for your survey but I am hoping this gives you some clues. There are some additional details about summary sections in here: https://community.esri.com/t5/arcgis-survey123-blog/survey123-tricks-of-the-trade-summary-sections-i...
Hi. By the online reference I meant that cheat sheet page that appears in the Survey123 website where you can see the name of the different questions in your form. Like shown below. This page is important as it helps you get the right field names and values for your queries.
In any event, start with just on table and when you get the syntax right you can add the second. For example, drop Patrol Checks for now and lets focus on Significant Cases.
Attaching v15, although I am going a bit blind without the reference.
Awesome! The PDF is looking good! The syntax can be tricky sometimes, but once you get the gist of it you can do pretty nice things with it. I am not sure if you need it, but you can add headers and also break down the case, description and other case info into separate columns within your Word table. Happy you got this going!
The goal of the PDF is to eliminate column 1 of each table. If I can just get the SIGNIFICANT CASE section to just show the "significant cases" and the same for the PATROL CHECK section, I'm golden!!! Everything looks right. I just don't know what I'm missing. Thanks for your time.
BTW, what kind of "code" or "syntax" is this? MS Word specific? Interested in finding sources for learning more about it. Thanks.