Select to view content in your preferred language

Connect: More precise error notifications: Highlight the issue in the sheet

125
0
4 weeks ago
Status: Open
Labels (1)
AlfredBaldenweck
MVP Regular Contributor

Related: Reports: Highlight problem areas in the report tem... - Esri Community

I'm working on a long and complex form in Connect. 

I saved and got this error message:

b'ODK Validate Errors:\n..XForm is invalid. See above for the errors.\norg.javarosa.xform.parse.XFormParseException: Invalid calculate for the bind attached to "${question}": Unbalanced brackets or parentheses! in expression...

if(selected(${serialnum}, 'Trespass'), ""na"", if(selected(${abvgrnd}, 'Yes and in need of repair') or selected(${bridge}, 'Major Issues (bridge is at imminent risk of or has collapsed)') or selected(${burm}, 'Animal_activity_compromising_burm') or selected(${burm}, 'Burm_incorrect_size') or selected(${canal}, 'Poor (blocked, collapsed canal walls, no access due to vegetation)') or selected(${catlgrd}, 'Needs_attention_(broken_and_in_need_of_repair)') or selected(${catlgrd}, 'Needs_attention_(filled_in_and_needs_cleaned_out)') or selected(${culverts}, 'Moderate Issues (frequent blockages or partial failure)') or selected(${culverts}, 'Major Issues (significant blockages or failure)') or selected(${fence}, 'Major Issues (fence is down or portions missing)') or selected(${erosctrl}, 'Poor (no effective erosion control measures)') or selected(${gates}, 'Needs attention (broken and in need of repair)') or selected(${guywire}, 'Major Issues (tower at risk)') or selected(${mettwr}, 'Moderate Issues (needs immediate attention)') or selected(${mettwr}, 'Major Issues (tower down and in complete disrepair)') or selected(${padcond}, 'Fair (some noticeable ruts, washboarding)') or selected(${padcond}, 'Poor (severe ruts, washboarding, potholes)') or selected(${poles}, 'Major (needs immediate attention)') or selected(${rdcond}, 'Moderate Issues (large mudholes, moderate ruts)') or selected(${rdcond}, 'Major Issues (washout or road unusable)') or selected(${safehaz}, 'Abandoned_equipment') or selected(${safehaz}, 'Debris_hanging_from_wires') or selected(${safehaz}, 'Exposed_Pipes') or selected(${safehaz}, 'Heavy_animal_activity') or selected(${safehaz}, 'Leaks') or selected(${safehaz}, 'Loose_frayed_or_downed_wires') or selected(${safehaz}, 'Potholes_and_ruts') or selected(${safehaz}, 'Sinkholes_Mud') or selected(${safehaz}, 'Trash_other_debris_in_or_around_site') or selected(${signage}, 'Moderate Issues (not visable or unreadable or missing/incorrect information)') or selected(${signage}, 'Sign installation required') or selected(${snwfnc}, 'Fair (missing or damaged slats)') or selected(${snwfnc}, 'Poor (collapsed, needs removed or replaced)') or selected(${structures}, 'Fair (maintenance needed)') or selected(${structures}, 'Poor (structures collapsed, needs removed or replaced)') or selected(${srfdran}, 'Poor (significant pooling, erosion, or washouts)') or selected(${turbine}, 'Major Issues (immediate attention required)') or selected(${turbfnd}, 'Moderate (needs attention broken and in need of repair)') or selected(${turbfnd}, 'Major (stability of pad compromised)') or selected(${veg}, 'Needs seeding') or selected(${weeds}, 'Invasive_>_10%_(needs_treated)') or selected(${weeds}, 'Noxious_(treat_immediately)') or selected(${hazfnd}, 'yes')), ""no"", """"))

Cool! Can you find the error?

.

.

.

It's this:

selected(${hazfnd}, 'yes'))

This sort of thing takes AGES to track down. I just put one in there on purpose, and I looked away and couldn't find it a minute later.

To echo my request in the linked post, I'd love there to be more specific error callouts in the Excel form.

Perhaps a plugin with a syntax button checker? Like, PLEASE highlight the issues (or idk add a comment to them?)

Especially with the brackets, I end up pasting into a different text editor because Excel won't highlight pairs unless the expression is preceded by a =, but then it'll get mad at you for improper excel syntax if you accidentally press enter.

A syntax checker highlighter in the Excel sheet would be a huge timesaver for debugging.