!= In relevant field - Is this still not acceptable

538
2
Jump to solution
02-18-2021 07:24 AM
LeonardBarnhill
Occasional Contributor

This question was brought up in 2017, is the use of "not equal" still not acceptable in the Relevant field?  I have the statement selected(${StrucDetail} != 'JCT') that generates an error message when the XLSForm is saved:

"Error evaluating field 'StrucDiam': The problem is located in Relevant expression for S{StrucDiam}  ... cannot handle function 'selected' requires 2 arguments ...

There is a long list of Choices for the StrucDetail select_one STRUCTYP and this is the only one not needing a diameter .

Suggestions please

0 Kudos
1 Solution

Accepted Solutions
DougBrowning
MVP Esteemed Contributor

First you have the parens in the wrong spot. Should be  selected(${StrucDetail}) != 'JCT'.  But I think selected returns true.  So just selected(${StrucDetail}) may work.

You only really need to use selected for select multiple.  Did you try just ${StrucDetail} != 'JCT'?

Hope that helps

View solution in original post

2 Replies
DougBrowning
MVP Esteemed Contributor

First you have the parens in the wrong spot. Should be  selected(${StrucDetail}) != 'JCT'.  But I think selected returns true.  So just selected(${StrucDetail}) may work.

You only really need to use selected for select multiple.  Did you try just ${StrucDetail} != 'JCT'?

Hope that helps

LeonardBarnhill
Occasional Contributor

The second solution did the trick ...  ${StrucDetail} != 'JCT'

Using this format is preferred for select_one queries?  I have been using the selected...  You can also see the use of parens in the begin group relevant field matched my use of parens in the errant statement.  Does the "not equal" expression change how parens should be used?  I am just trying to understand the use of parens - this is a constant problem trying to guess when the close parens is after the name field and when it should be after the parameter.

Thanks for your time

0 Kudos