<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://community.appian.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Trying to use a rule inside a validation</title><link>https://community.appian.com/discussions/f/general/25469/trying-to-use-a-rule-inside-a-validation</link><description>I have a validation on a dateField that I am trying to use a rule inside of the if statement. See below. 
 I get a &amp;quot;Cast Invalid Could not cast from Rule or Function Reference to Boolean&amp;quot; when I add the first rule. Is there something I should look for</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: Trying to use a rule inside a validation</title><link>https://community.appian.com/thread/99220?ContentTypeID=1</link><pubDate>Tue, 09 Aug 2022 13:59:26 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:16e32f84-06b7-4a74-96eb-f7d64bdf65ae</guid><dc:creator>Mike Schmitt</dc:creator><description>&lt;p&gt;i agree that it&amp;#39;s time to double-check for syntax errors.&amp;nbsp; I&amp;#39;d suggest the OP post a screenshot of where the rule is called in their validation setup, just in case there&amp;#39;s something being missed.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Trying to use a rule inside a validation</title><link>https://community.appian.com/thread/99218?ContentTypeID=1</link><pubDate>Tue, 09 Aug 2022 13:49:24 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:424697f4-9efd-4850-abc3-b8250c31f3e9</guid><dc:creator>Harshit Bumb (Appyzie)</dc:creator><description>&lt;p&gt;With the error, it looks like somewhere there is a space in the rule name or between the name and the brackets.&amp;nbsp;&lt;br /&gt;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.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Trying to use a rule inside a validation</title><link>https://community.appian.com/thread/99217?ContentTypeID=1</link><pubDate>Tue, 09 Aug 2022 13:48:27 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:0eb17994-49da-422a-b7aa-1c0a03e1daea</guid><dc:creator>deepakg681722</dc:creator><description>&lt;p&gt;both the rules are returning boolean values individually? it will be great if you can share the code of your rules as well&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Trying to use a rule inside a validation</title><link>https://community.appian.com/thread/99216?ContentTypeID=1</link><pubDate>Tue, 09 Aug 2022 13:33:02 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:a8083c37-c284-4f64-97d0-631a275d045b</guid><dc:creator>brafb6685</dc:creator><description>&lt;p&gt;It always returns a boolean, but adding toboolean() gives me almost the same error.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Trying to use a rule inside a validation</title><link>https://community.appian.com/thread/99211?ContentTypeID=1</link><pubDate>Tue, 09 Aug 2022 13:19:31 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:4471030f-d793-4717-a674-522786287cbb</guid><dc:creator>Mike Schmitt</dc:creator><description>&lt;p&gt;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 &amp;quot;a, b, c&amp;quot; that could be passed in from your interface.&amp;nbsp; That would include passing in nulls, incorrect values, etc.&lt;/p&gt;
&lt;p&gt;Also you could post the code for the rule that doesn&amp;#39;t work, and/or a screenshot of its output.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Trying to use a rule inside a validation</title><link>https://community.appian.com/thread/99210?ContentTypeID=1</link><pubDate>Tue, 09 Aug 2022 13:17:45 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:8bbb7447-478b-4131-a482-1279f829faec</guid><dc:creator>Harshit Bumb (Appyzie)</dc:creator><description>&lt;p&gt;Two things&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Make sure your rule is returning a boolean value&lt;/li&gt;
&lt;li&gt;Wrap toboolean() around both the functions so there isn&amp;#39;t any type mismatch error.&lt;/li&gt;
&lt;/ol&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Trying to use a rule inside a validation</title><link>https://community.appian.com/thread/99209?ContentTypeID=1</link><pubDate>Tue, 09 Aug 2022 13:17:35 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:90becf1b-36fb-459b-9c02-36d8366f5553</guid><dc:creator>brafb6685</dc:creator><description>&lt;p&gt;Yes. It does return a boolean output.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Trying to use a rule inside a validation</title><link>https://community.appian.com/thread/99208?ContentTypeID=1</link><pubDate>Tue, 09 Aug 2022 13:16:37 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:5f552551-e431-47b2-9e98-902c830ac69c</guid><dc:creator>Mike Schmitt</dc:creator><description>&lt;p&gt;At first glance the syntax looks valid - when you open the first rule and run it, does it return a valid (Boolean type) output?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>