<?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>Is there a way to convert a String to evaluable SAIL expression ?   I</title><link>https://community.appian.com/discussions/f/rules/4246/is-there-a-way-to-convert-a-string-to-evaluable-sail-expression-i</link><description>Is there a way to convert a String to evaluable SAIL expression ? I have a comparative expression saved in a database field, I need to retrieve it from the database and evaluate it within a condition in SAIL. OriginalPostID-137948 OriginalPostID-1379</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: Is there a way to convert a String to evaluable SAIL expression ?   I</title><link>https://community.appian.com/thread/86947?ContentTypeID=1</link><pubDate>Wed, 13 Oct 2021 15:39:18 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:23ea8f89-f375-4717-809a-c04090aaa776</guid><dc:creator>Mike Schmitt</dc:creator><description>&lt;p&gt;No need to feed the zombie thread ;-)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Is there a way to convert a String to evaluable SAIL expression ?   I</title><link>https://community.appian.com/thread/86946?ContentTypeID=1</link><pubDate>Wed, 13 Oct 2021 15:31:15 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:8d1c660f-6659-4491-a27d-0bec91e9a645</guid><dc:creator>Stewart Burchell</dc:creator><description>&lt;p&gt;BEWARE! This is an unsupported function.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;img src="/resized-image/__size/320x240/__key/communityserver-discussions-components-files/15/pastedimage1634139040093v1.png" alt=" " /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Is there a way to convert a String to evaluable SAIL expression ?   I</title><link>https://community.appian.com/thread/86945?ContentTypeID=1</link><pubDate>Wed, 13 Oct 2021 15:17:17 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:2c2849ba-5025-4a02-92c3-a6b1ded10f46</guid><dc:creator>saurabhrajnala</dc:creator><description>&lt;p&gt;Thanks for that reply. Really helpful!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Is there a way to convert a String to evaluable SAIL expression ? &lt;br /&gt;&lt;br /&gt;I</title><link>https://community.appian.com/thread/15215?ContentTypeID=1</link><pubDate>Wed, 11 Feb 2015 15:48:30 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:45fd6b21-21c8-4c2a-a379-73a5afd4c27e</guid><dc:creator>Raj Yadla</dc:creator><description>Thanks all ,eval() did the trick for me.&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Is there a way to convert a String to evaluable SAIL expression ? &lt;br /&gt;&lt;br /&gt;I</title><link>https://community.appian.com/thread/15181?ContentTypeID=1</link><pubDate>Wed, 11 Feb 2015 01:00:09 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:7415afed-7a86-4218-8404-29bcb135b04e</guid><dc:creator>Mike Schmitt</dc:creator><description>Per jackm&amp;#39;s comments earlier, it looks like eval() might be something you can leverage to handle these.  It is an undocumented function as of 7.8 at least, so Appian Best Practices (AFAIK) recommend it to be used very cautiously if at all.  However, given that, I was able to test it as working in both of the code examples you posted earlier.  What&amp;#39;s more, you can push a value into a local variable and then evaluate text containing that local variable.&lt;br /&gt;i.e.&lt;br /&gt;&lt;br /&gt;=load(&lt;br /&gt;  local!value: &amp;quot;asdf&amp;quot;,&lt;br /&gt;  eval(&lt;br /&gt;    &amp;quot;len(local!value)=4&amp;quot;&lt;br /&gt;  )&lt;br /&gt;)&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Is there a way to convert a String to evaluable SAIL expression ? &lt;br /&gt;&lt;br /&gt;I</title><link>https://community.appian.com/thread/15178?ContentTypeID=1</link><pubDate>Tue, 10 Feb 2015 21:22:38 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:77910b5c-2d27-4410-ae8f-171e7f126c8a</guid><dc:creator>radhaa</dc:creator><description>correction- we can&amp;#39;t able to do that. it won&amp;#39;t be possible in appian&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Is there a way to convert a String to evaluable SAIL expression ? &lt;br /&gt;&lt;br /&gt;I</title><link>https://community.appian.com/thread/15171?ContentTypeID=1</link><pubDate>Tue, 10 Feb 2015 19:56:48 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:e23f5104-ed00-4400-95fa-13d3a319b043</guid><dc:creator>radhaa</dc:creator><description>Hi rajendray,&lt;br /&gt;According to your comments, you need a decision table (which contains set of dynamic rules like nested if conditions/multiple conditional constraints, which might be handled by end user also). So to achieve this you stored those rules in DB and try to evaluate it.&lt;br /&gt;But AFAIK, you can&amp;#39;t able to do that in Appian. &lt;br /&gt;&lt;br /&gt;If you have fixed set of operators, comparing values also be quantifiable numbers and only one operator is used for each expression like 10&amp;gt;20, then you may try by splitting the expression by operator.&lt;br /&gt;As your comments ,I think you don&amp;#39;t want this.&lt;br /&gt;&lt;br /&gt;So my suggestion is consider your requirement once and design it in Appian supported way.&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Is there a way to convert a String to evaluable SAIL expression ? &lt;br /&gt;&lt;br /&gt;I</title><link>https://community.appian.com/thread/15170?ContentTypeID=1</link><pubDate>Tue, 10 Feb 2015 19:53:21 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:f2900eee-58bc-4076-8884-725f223b3dc2</guid><dc:creator>jackm829</dc:creator><description>rajendray, to update my previous response in light of your previous comment about your use case, you could use eval() directly in the SAIL condition.&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Is there a way to convert a String to evaluable SAIL expression ? &lt;br /&gt;&lt;br /&gt;I</title><link>https://community.appian.com/thread/15169?ContentTypeID=1</link><pubDate>Tue, 10 Feb 2015 19:47:23 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:0f00190f-79ee-414e-8a3b-a2316c20c671</guid><dc:creator>jackm829</dc:creator><description>You could try eval().  My understanding is that this is an undocumented function.  You will have to test to make sure that it works with your Appian version. Example: eval(&amp;quot;count({1,2,3})&amp;quot;) returns 3.  In your case, you may want to have an expression rule with a text input with the expression, and use eval(ri!input) as the rule definition.&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Is there a way to convert a String to evaluable SAIL expression ? &lt;br /&gt;&lt;br /&gt;I</title><link>https://community.appian.com/thread/15166?ContentTypeID=1</link><pubDate>Tue, 10 Feb 2015 19:05:07 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:bfcf8cc3-751d-4653-8171-5f60e6f5ceae</guid><dc:creator>Raj Yadla</dc:creator><description>@mschmitt : we could define an exclusive list of operators ,but then if anything new arises we may need to change the code also the expectation is it should handle reg ex which we may not do by segregating the condition&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Is there a way to convert a String to evaluable SAIL expression ? &lt;br /&gt;&lt;br /&gt;I</title><link>https://community.appian.com/thread/15165?ContentTypeID=1</link><pubDate>Tue, 10 Feb 2015 18:59:37 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:2cd20a43-0b70-4148-9942-af9261536725</guid><dc:creator>Raj Yadla</dc:creator><description>@joshl : The usecase is to perform validations on the sail components(textfields,dropdowns..) which are created dynamically with an entry in the DB..these validations also have to be dynamic which is given in a DB so that it accomodates any new validations or even reg ex.&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Is there a way to convert a String to evaluable SAIL expression ? &lt;br /&gt;&lt;br /&gt;I</title><link>https://community.appian.com/thread/15164?ContentTypeID=1</link><pubDate>Tue, 10 Feb 2015 18:51:27 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:d3c22b58-3f2e-4d17-a8cb-3c7c0b1929ec</guid><dc:creator>Mike Schmitt</dc:creator><description>Per what others have said - if it absolutely has to be done this way, other than designing some new plugin to interpret the text commands, all I can think of personally would be to break up the text expressions into separate pieces and evaluate them via conditional statements (which would be difficult).  You&amp;#39;d have to have a well-defined business rule regarding what format the expressions could have (i.e. the operators they could handle, the length, etc), but the plus side is that the evaluation rule could always be expanded in the future to handle more things.&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Is there a way to convert a String to evaluable SAIL expression ? &lt;br /&gt;&lt;br /&gt;I</title><link>https://community.appian.com/thread/15163?ContentTypeID=1</link><pubDate>Tue, 10 Feb 2015 18:44:06 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:9c6711e4-8834-4936-b040-b7648834ddee</guid><dc:creator>William Ruck</dc:creator><description>That&amp;#39;s what I was afraid of. Appian does not support the interpretation and execution of strings as SAIL expressions.  If you are building conditions dynamically or such that they are very situation dependent, a series of nested rules that encompass your logic would be appropriate.&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Is there a way to convert a String to evaluable SAIL expression ? &lt;br /&gt;&lt;br /&gt;I</title><link>https://community.appian.com/thread/15162?ContentTypeID=1</link><pubDate>Tue, 10 Feb 2015 18:43:55 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:c7265879-8762-45e8-abad-5d2b4f3b322f</guid><dc:creator>Josh</dc:creator><description>Why not just evaluate your conditions in Appian? What is the use case for storing expressions directly in the database?&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Is there a way to convert a String to evaluable SAIL expression ? &lt;br /&gt;&lt;br /&gt;I</title><link>https://community.appian.com/thread/15161?ContentTypeID=1</link><pubDate>Tue, 10 Feb 2015 18:41:22 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:ad51d64f-8d78-4e07-8498-e47670907292</guid><dc:creator>Raj Yadla</dc:creator><description>@mschmitt : its not finite and also the requirement is to have it dynamic , the usage of nested if doesnt serve our purpose to be able to add new conditions&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Is there a way to convert a String to evaluable SAIL expression ? &lt;br /&gt;&lt;br /&gt;I</title><link>https://community.appian.com/thread/15159?ContentTypeID=1</link><pubDate>Tue, 10 Feb 2015 18:39:19 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:66f8b98f-ecca-4c09-8bb3-541912eb85cc</guid><dc:creator>Raj Yadla</dc:creator><description>In DB i would have conditions such as value&amp;gt;4 or len(value)=2 or even an regular expression , the value will be a local variable or a pv which is defined in the interface where i use this .&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Is there a way to convert a String to evaluable SAIL expression ? &lt;br /&gt;&lt;br /&gt;I</title><link>https://community.appian.com/thread/15156?ContentTypeID=1</link><pubDate>Tue, 10 Feb 2015 18:10:28 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:83681191-8db7-43ef-a966-97aab114ca5c</guid><dc:creator>Mike Schmitt</dc:creator><description>What is the variety of different comparative expressions you might have saved in the database field?  If it&amp;#39;s finite and relatively few, you could always evaluate the string in an IF() statement and then perform the appropriate expression depending on how the IF() evaluated...&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Is there a way to convert a String to evaluable SAIL expression ? &lt;br /&gt;&lt;br /&gt;I</title><link>https://community.appian.com/thread/15153?ContentTypeID=1</link><pubDate>Tue, 10 Feb 2015 17:34:09 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:38e73dcd-20b5-41e8-878b-0737ee2e54cf</guid><dc:creator>William Ruck</dc:creator><description>Could you give an example of the kind of comparative expression you mean? Do you mean you are storing a literal SAIL expression (e.g. an a!gridField) in the database, and want to have it evaluate?&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>