Appian Community and Appian Academy are being upgraded. From July 24–August 3, the Appian Community will be in read-only mode. During this time, the site will be read-only and user registration will be disabled. We apologize for any inconvenience this may cause, but a more secure, stable, and performant Community experience is coming soon!
The new Appian Community launches August 3, followed by Appian Academy on August 7. During the migration, Appian Community Edition, Appian Academy, Documentation, Certifications, Instructor-led Customer Training, Partner Sales Training & Accreditation, and Forum (for Appian Partners and Customers only) will remain available.
I have a validation on a dateField that I am trying to use a rule inside of the if statement. See below.
validations: { if( and( rule!someRuleThatDoesntWorkHere(a, b, c), rule!someRuleThatWorks(a) ), "message goes here", {} ) }
I get a "Cast Invalid Could not cast from Rule or Function Reference to Boolean" when I add the first rule. Is there something I should look for specifically.
Discussion posts and replies are publicly visible
At first glance the syntax looks valid - when you open the first rule and run it, does it return a valid (Boolean type) output?
Yes. It does return a boolean output.
Two things
Also check to verify that it still returns a valid boolean response (and not, for example, nulls or an error) for all possible values of "a, b, c" that could be passed in from your interface. That would include passing in nulls, incorrect values, etc.
Also you could post the code for the rule that doesn't work, and/or a screenshot of its output.
It always returns a boolean, but adding toboolean() gives me almost the same error.
both the rules are returning boolean values individually? it will be great if you can share the code of your rules as well
With the error, it looks like somewhere there is a space in the rule name or between the name and the brackets. The only way to find it is to isolate the error. Try removing code blocks and see what was causing this issue. Once you find that block, start doing the same in that block too.
i agree that it's time to double-check for syntax errors. I'd suggest the OP post a screenshot of where the rule is called in their validation setup, just in case there's something being missed.