<?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>Question about constans, proccess models, and expression</title><link>https://community.appian.com/discussions/f/general/29084/question-about-constans-proccess-models-and-expression</link><description>Hi, 
 I need help, well I need to make an evaluation from a process some data of a constant, this constant contains two decimal data. 
 I have something like this 
 With( 
 Pv!httpCall=200, 
 Pv!evaluate&amp;lt;cons!DATA_TO_EVAL 
 ) 
 Assuming that my constant</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: Question about constans, proccess models, and expression</title><link>https://community.appian.com/thread/114962?ContentTypeID=1</link><pubDate>Sun, 25 Jun 2023 07:33:40 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:a9327be4-275c-49fc-ab8d-f4452d3d9ceb</guid><dc:creator>Stefan Helzle</dc:creator><description>&lt;p&gt;This is exactly a case for which I recommend to NOT use a constant with multiple values. Why?&lt;/p&gt;
&lt;p&gt;When not using any constants, your code would be like this:&lt;/p&gt;
&lt;p&gt;if(local!value &amp;gt; 42, dothis, dothat)&lt;/p&gt;
&lt;p&gt;When using a constant with multiple values, it is this:&lt;/p&gt;
&lt;p&gt;if(local!value &amp;gt; cons!WHATEVER[7])&lt;/p&gt;
&lt;p&gt;This does not make your code any more readable and still ties the functionality of your code to a hard coded value. In this case the index number.&lt;/p&gt;
&lt;p&gt;My approach is:&lt;/p&gt;
&lt;p&gt;- Create a constant for each value giving it a great name&lt;/p&gt;
&lt;p&gt;- When a list of these values is needed, create an expression that creates that list.&lt;/p&gt;
&lt;p&gt;You now have readable code and no dependencies on&amp;nbsp;hard coded values&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Question about constans, proccess models, and expression</title><link>https://community.appian.com/thread/114958?ContentTypeID=1</link><pubDate>Sat, 24 Jun 2023 23:41:24 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:4e4159c6-2f22-48ee-8c41-e8b1dccce274</guid><dc:creator>Mathieu Drouin</dc:creator><description>&lt;p&gt;If I understood correctly, I think this is what you are looking for.&lt;/p&gt;
&lt;p&gt;Essentially, if all the items in the array meet a condition, it returns true, otherwise false. If you only need 1 item to be true, simply change the and() for an or(). You can adjust the condition to whatever you require.&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;and(
  a!forEach(
    items: { 200, 200, 200 },
    expression: fv!item = 200
  )
)&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Question about constans, proccess models, and expression</title><link>https://community.appian.com/thread/114957?ContentTypeID=1</link><pubDate>Sat, 24 Jun 2023 20:15:32 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:72ac7ef7-257d-423e-9e21-8476409b9d43</guid><dc:creator>Gustavo Silva</dc:creator><description>&lt;p&gt;Hi, I tried a different solution I think I was not given the explanation of what I needed in the requirement, so I used something similar to this&lt;br /&gt;assuming my constant is an array of 2 digits&lt;br /&gt;{&lt;br /&gt;8&lt;br /&gt;9&lt;br /&gt;}&lt;br /&gt;cons!MY_CONSTANT_DEMO[1], &lt;br /&gt;according to the option I needed, I only required the first item, &lt;br /&gt;and well, I still appreciate your support.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Question about constans, proccess models, and expression</title><link>https://community.appian.com/thread/114956?ContentTypeID=1</link><pubDate>Sat, 24 Jun 2023 20:13:53 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:58bc508e-d55e-43dd-9b4e-02f13a92f8f5</guid><dc:creator>Gustavo Silva</dc:creator><description>&lt;p&gt;I tried with another solution where from the constant, sending it to call, I selected for example&lt;br /&gt;assuming my constant has two values: &lt;br /&gt;{&lt;br /&gt;8&lt;br /&gt;9&lt;br /&gt;}, I needed the index of the first value, in this case &lt;br /&gt;Cons!MY_CONSTANT_VALUE[1],&lt;/p&gt;
&lt;p&gt;I think that for the requirements this is the solution that I needed... I still appreciate your support Stefan.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Question about constans, proccess models, and expression</title><link>https://community.appian.com/thread/114877?ContentTypeID=1</link><pubDate>Fri, 23 Jun 2023 09:24:52 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:7f0f034d-6276-42bd-8e53-d57bee90bfb4</guid><dc:creator>venkatrea696188</dc:creator><description>&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;a!foreach(
item:cons!constant,
expression:if(pv!data&amp;lt;fv!item, true(), false()) 
). Map these boolean result to some process variable use it else where for condtions

                          OR
{200}&amp;lt;{100,50} returns {true, true} map it to pv and use it elsewhere&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Question about constans, proccess models, and expression</title><link>https://community.appian.com/thread/114869?ContentTypeID=1</link><pubDate>Fri, 23 Jun 2023 06:28:40 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:a0eb8625-a3ac-4096-b412-8d82bb5bf77d</guid><dc:creator>sanchitg0002</dc:creator><description>[quote userid="132237" url="~/discussions/f/general/29084/question-about-constans-proccess-models-and-expression"]&lt;p&gt;If(&lt;/p&gt;
&lt;p&gt;cons!DATA_TO_EVAL,100,&amp;quot; IS HIGHER&amp;quot;&lt;/p&gt;
&lt;p&gt;)&lt;/p&gt;[/quote]
&lt;p&gt;What you are trying to do here? If you simply compare it just like how you did when it had single item i.e., Pv!evaluate&amp;lt;cons!DATA_TO_EVAL then also it will compare all items in that constant with pv and return list of boolean values.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Question about constans, proccess models, and expression</title><link>https://community.appian.com/thread/114859?ContentTypeID=1</link><pubDate>Fri, 23 Jun 2023 05:31:54 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:ae3a230d-aa80-48c0-b229-0f380fe9e246</guid><dc:creator>Stefan Helzle</dc:creator><description>&lt;p&gt;Did you consider to use a foreach to evaluate that process value against each of the values in the constant?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>