Select to view content in your preferred language

Better Help for the Conditional Elements of Survey123's Report Template

3288
5
07-20-2018 05:49 AM
Status: Open
LiamHarrington-Missin
Frequent Contributor

Currently the only help I can find on this is a small section in this link.  This is a potentially powerful feature in creating custom formatted reports and some extra help in a blog (with examples) would help users make better use of it.

5 Comments
LiamHarrington-Missin
ZhifangWang

Hi all, 

Thanks for your feedbacks.

We have the conditional elements section documented in the help topic now: Feature report templates—Survey123 for ArcGIS | ArcGIS . Did you find it useful?

MatFeltner

I'm getting 'generate' errors when use conditional syntax in my Word document like:

Owner:                                                  ${SiteTreeOwnership}

Type of Failure:                                    ${TreeFailureType}

${if ${TreeFailureType} == “TF”}

Trunk Failure Height:          ${TrunkFailureHeight}

Trunk Failure Diameter:     ${TrunkFailureDiameter}

${/}

Errors:

Error occurred when checking the report template. The tag beginning with "${TreeFail" is unclosedThe tag beginning with "${# " is unclosedThe tag beginning with "} == “RF”" is unopenedThe tag beginning with "${TreeFail" is unclosedThe tag beginning with "${# " is unclosedThe tag beginning with "} == “TF”" is unopenedThe tag beginning with "${TreeFail" is unclosedThe tag beginning with "${# " is unclosedThe tag beginning with "} == “BF”" is unopenedThe loop with tag "" is unopenedThe loop with tag "" is unopenedThe loop with tag "" is unopened
Failed Object IDs
DudleyHartel

Using this documented syntax in Word document...

Type of Failure:                                    ${TreeFailureType}

${if ${TreeFailureType} == “RF”}

Root Failure Type:               ${RootFailureType}

${/}

${if ${TreeFailureType} == “TF”}

Trunk Failure Height:          ${TrunkFailureHeight}

Trunk Failure Diameter:     ${TrunkFailureDiameter}

${/}

${if ${TreeFailureType} == “BF”}

Branch Diameter:                ${BranchBreakDiameter}

Branch Length:                     ${BranchLength}

${/}

I get error messages...

Error occurred when checking the report template. The tag beginning with "${TreeFail" is unclosedThe tag beginning with "${# " is unclosedThe tag beginning with "} == “RF”" is unopenedThe tag beginning with "${TreeFail" is unclosedThe tag beginning with "${# " is unclosedThe tag beginning with "} == “TF”" is unopenedThe tag beginning with "${TreeFail" is unclosedThe tag beginning with "${# " is unclosedThe tag beginning with "} == “BF”" is unopenedThe loop with tag "" is unopenedThe loop with tag "" is unopenedThe loop with tag "" is unopened

DudleyHartel

I determined the syntax error with some trial and error...

  1. within the $If{ } ... $if{/} sequence, the attributes used in the expression use their Survey123 Excel workbook name WITHOUT the ${<name>} syntax 
  2. the equality '==' within an If expression is also the Excel workbook "choices" label NOT the name.

This works...

Failure:

${TreeFailureType}  [correct syntax outside the if conditional element]

${if TreeFailureType == “Root Failure”}               [correct syntax inside for the if conditional element]

Root Failure Type:

${RootFailureType}  [correct syntax for referencing the attribute value in the if element]

${/}

This doesn't...

Type of Failure:                                       ${TreeFailureType} [correct syntax outside the if conditional element]

${if ${TreeFailureType} == “RF”}      [this is NOT correct syntax for referencing the attribute]

Root Failure Type:                  ${RootFailureType}

${/}