Is it "if" or is it "select" or "filter"????

2271
13
Jump to solution
01-28-2021 10:18 AM
LanceEber
New Contributor II

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

0 Kudos
13 Replies
IsmaelChivite
Esri Notable Contributor

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

 

0 Kudos
LanceEber
New Contributor II

Hi Ismael,

Here's what I did:  after your first reply, I typed into my template exactly how you had the syntax.  I typed it and retyped and retyped and retyped and none of them worked. Took a break for a few hours. Came back to it. Typed it again.  Still nothing.  Then, decided to just copy/paste your "line" from the reply into my template. By golly, it worked!!!!  I changed the "orderByField" to what I wanted and voila.  Success.  Honestly, I don't what was different.  To me, it looks exactly the same.  But, doing a copy/paste of yours worked.  Frustrating, but relieving at the same time.

I appreciate your time submitting your help.  I even reached out to Chris Delaney (my law enforcement contact) for some guidance.

Other than the "order" field, I don't know what's different.

Here is the working report!!!  Thanks again : )

0 Kudos
IsmaelChivite
Esri Notable Contributor

@LanceEber  I am guessing he difference is 'straight quotes' versus 'smart quotes'.  By default, Microsoft Word will add 'smart quotes' as you type. The Survey123 report engine likes 'straight' quotes.

Check the section 'Straighten' your quotes in this article https://community.esri.com/t5/arcgis-survey123-blog/survey123-tricks-of-the-trade-summary-sections-i...

Sometimes I end up tying my where syntax in notepad and then copying and pasting into Word. You can also configure Ms Word to use straight quotes as described here: https://support.microsoft.com/en-us/office/smart-quotes-in-word-702fc92e-b723-4e3d-b2cc-71dedaf2f343

Thanks for sharing!

0 Kudos
LanceEber
New Contributor II
Ahhh, that makes sense. I'll keep this in mind for sure.