0

This is my code to add an expression into a formatting rule in InfoPath 2013 0- I am trying to get around the 5 rule limit.

not(contains(my:Spec, "Select")) and not(contains(my:Spec, "001")) and not(contains(my:Spec, "004")) and not(contains(my:Spec, "005")) and not not(contains(my:Spec, "007")) and not(contains(my:Spec,"008")) and and not(contains(my:Spec,"028")) and not(contains(my:Spec,"030")) and not(contains(my:Spec,"042")) and not(contains(my:Spec,"044")) and not(contains(my:Spec,"047")) and not(contains(my:Spec,"048")) and not(contains(my:Spec,"052")) and not(contains(my:Spec,"058")) and not(contains(my:Spec,"060")) and not(contains(my:Spec,"062")) and not(contains(my:Spec,"063")) and not(contains(my:Spec,"068")) and not(contains(my:Spec,"070")) and not(contains(my:Spec,"071")) and not(contains(my:Spec,"074")) and not(contains(my:Spec,"075")) and not(contains(my:Spec,"076")) and not(contains(my:Spec,"086")) and not(contains(my:Spec,"087")) and not(contains(my:Spec,"10000022"))

However I get the following error when I try to save the rule:

The following expression is not valid Expected value type: end-of-string

Can anyone help me out here - I have 70+ fields which I need to so the same hide/show options based on another single fields drop down box option selection (this one has 60-70 options to choose from)

0

Found the issue - there were syntax errors in my original code - I has repeated not in the same part of the expression, hence the end string error message.

The correct code to use where you want something hidden based on a field NOT being a given condition is below.

not(contains(my:Spec, "Select")) and not(contains(my:Spec, "001")) and not(contains(my:Spec, "004")) and not(contains(my:Spec, "005")) and not(contains(my:Spec, "007")) and not(contains(my:Spec, "008")) and not(contains(my:Spec, "028")) and not(contains(my:Spec, "030")) and not(contains(my:Spec, "042")) and not(contains(my:Spec, "044")) and not(contains(my:Spec, "047")) and not(contains(my:Spec, "048")) and not(contains(my:Spec, "052")) and not(contains(my:Spec, "058")) and not(contains(my:Spec, "060")) and not(contains(my:Spec, "062")) and not(contains(my:Spec, "063")) and not(contains(my:Spec, "068")) and not(contains(my:Spec, "070")) and not(contains(my:Spec, "071")) and not(contains(my:Spec, "074")) and not(contains(my:Spec, "075")) and not(contains(my:Spec, "076")) and not(contains(my:Spec, "086")) and not(contains(my:Spec, "087")) and not(contains(my:Spec, "10000022"))

where Spec is the field whose selection the conditions are based upon, and the items in inverted commas are the conditions.

Feel a bit silly for answering my own question, but wanted to share the solution with all

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.