ERROR 500 - form availability

Hello, I’m trying to make a form available for use but every time I try this error message appears, could you help me?

Welcome back to the community, @barata_clicia1! Have you validated your XLSForm through this online validator? The online validator should help you identify syntax issues if any are present that are affecting your form deployment.

this error appears in the link you sent, however, when I click on the eye symbol the form appears normally and all the calculations are performed successfully, but I can’t publish the form

Error: ODK Validate Errors:
>> XForm is invalid.
: Invalid calculate for the bind attached to “${media_cond_GAC}” : Bad node: org.javarosa.xpath.parser.ast.ASTNodeAbstractExpr@6ee52dcd in expression if( ${_1_6_media_cond_GA} <=2.49,‘Classificação dos totais médios: Ruim’,if( ${_1_6_media_cond_GA} >=2.5 and ( ${_1_6_media_cond_GA} <=4.99),‘Classificação dos totais médios: Regular’,if( ${_1_6_media_cond_GA} >=5 and ( ${_1_6_media_cond_GA} <=7.49),‘Classificação dos totais médios: Bom’,if( ${_1_6_media_cond_GA} >=7.5 and ( ${_1_6_media_cond_GA} <=10, ‘Classificação dos totais médios: Excelente’)))))

Can you please post your form here to review.

1 Like

a4zLWAFm9Jaz4evaMGgiah.xlsx (8.8 KB)

So your long nested-if calculation for media_cond_GAC appears to be missing its final ‘else’ value:

This is your calculation:

if(${_1_6_media_cond_GA} <=2.49,'Classificação dos totais médios: Ruim',if(${_1_6_media_cond_GA} >=2.5 and (${_1_6_media_cond_GA}<=4.99),'Classificação dos totais médios: Regular',if(${_1_6_media_cond_GA}>=5 and (${_1_6_media_cond_GA}<=7.49),'Classificação dos totais médios: Bom',if(${_1_6_media_cond_GA}>=7.5 and (${_1_6_media_cond_GA}<=10, 'Classificação dos totais médios: Excelente')))))

but you will notice, the final nested if() lacks an else value, and its parenthesis is misplaced; that is

if(${_1_6_media_cond_GA}>=7.5 and (${_1_6_media_cond_GA}<=10, 'Classificação dos totais médios: Excelente')))))

should be something like

if(${_1_6_media_cond_GA}>=7.5 and (${_1_6_media_cond_GA}<=10), 'Classificação dos totais médios: Excelente', 'FOOBAR'))))

If you fix these your form will compile without errors (but obviously change my FOOBAR to whatever is appropriate!)

242d6524df8f7035df9834cc86924cd5109d9dcc-FIXED.xlsx (12.5 KB)

1 Like