<?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>How do you pass process variable parameter into an expression</title><link>https://community.appian.com/discussions/f/data/23985/how-do-you-pass-process-variable-parameter-into-an-expression</link><description>I am trying to pass the value of a process variable into my expression, and the expression is also used in the process model. 
 Please, see attached image: 
 
 
 The rule - drxxxxStoredProcedureDirDepAggregatedPaymentForDate looks like this: 
 executestoredprocedure</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: How do you pass process variable parameter into an expression</title><link>https://community.appian.com/thread/92474?ContentTypeID=1</link><pubDate>Sat, 19 Mar 2022 17:52:11 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:b04c8830-ed64-4083-b88f-2404aace2676</guid><dc:creator>Mike Schmitt</dc:creator><description>&lt;p&gt;Gopalk beat me to it.&amp;nbsp; My current recommendation is to not use load() under any circumstances, and that legacy code using it should be converted as soon as convenient since load() and its sister function with() are deprecated now.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How do you pass process variable parameter into an expression</title><link>https://community.appian.com/thread/92466?ContentTypeID=1</link><pubDate>Sat, 19 Mar 2022 05:08:27 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:44bd0559-2fb8-45e2-97ba-2e93eade8534</guid><dc:creator>GopalK</dc:creator><description>&lt;p&gt;Hi&amp;nbsp;&lt;a class="internal-link view-user-profile" href="/members/nicholaso0002"&gt;nicholaso0002&lt;/a&gt;, I am not sure if you are aware but a!localVariables is one of the latest functions which Appian has introduced from 20.2 . It has significant advantages over load and with. You will have more control over how your local variable refreshes in combination with&amp;nbsp;&lt;span&gt;a!refreshVariable. it simplifies the UI and helps you to create more efficient interfaces.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Please go through the documentation to know more,&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;a href="https://docs.appian.com/suite/help/22.1/fnc_evaluation_a_localvariables.html"&gt;https://docs.appian.com/suite/help/22.1/fnc_evaluation_a_localvariables.html&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How do you pass process variable parameter into an expression</title><link>https://community.appian.com/thread/92465?ContentTypeID=1</link><pubDate>Fri, 18 Mar 2022 22:30:32 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:53959e93-43ab-4416-81c3-267f6eda9811</guid><dc:creator>nicholaso0002</dc:creator><description>&lt;p&gt;Thank you, Mike. I have tested it and it worked. Is there a reason you used a!localvariables instead of load&lt;/p&gt;
&lt;p&gt;Thanks&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How do you pass process variable parameter into an expression</title><link>https://community.appian.com/thread/92398?ContentTypeID=1</link><pubDate>Thu, 17 Mar 2022 21:02:51 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:967032f1-1dac-43d9-a110-6d163bb06a9a</guid><dc:creator>Mike Schmitt</dc:creator><description>&lt;p&gt;You&amp;#39;re already setting one local variable, local!lines - you&amp;#39;d just create an earlier local variable within your load() statement (though i beg you to please switch this&amp;nbsp;&lt;em&gt;&lt;strong&gt;load()&lt;/strong&gt;&lt;/em&gt; out for&amp;nbsp;&lt;strong&gt;&lt;em&gt;a!localVariables()&lt;/em&gt;&lt;/strong&gt;&lt;em&gt;&lt;/em&gt; for your sanity and mine), move the stored procedure call to that local variable, then refer to the local variable in the subsequent places you called the SP directly.&lt;/p&gt;
&lt;p&gt;This would look a little something like:&lt;br /&gt;&lt;pre class="ui-code" data-mode="java"&gt;a!localVariables(
  
  local!procedureResult: rule!mySuperLongStoredProedureExpressionRuleName(&amp;quot;3/17/2022&amp;quot;),
  
  local!lines: if(
    a!isNullOrEmpty(local!procedureResult),
    {&amp;quot;No Data, 0.000000.123456789.0 etc&amp;quot;},
    
    {
      a!forEach(
        items: local!procedureResult,
        expression: {
          /* all your code here would be essentially unchanged */
        }
      )
    }
  )
)&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How do you pass process variable parameter into an expression</title><link>https://community.appian.com/thread/92397?ContentTypeID=1</link><pubDate>Thu, 17 Mar 2022 20:48:17 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:87866442-9529-4399-a35b-0beb7aa19e4b</guid><dc:creator>Stefan Helzle</dc:creator><description>&lt;p&gt;&lt;a href="https://docs.appian.com/suite/help/22.1/Local_Variables.html"&gt;docs.appian.com/.../Local_Variables.html&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How do you pass process variable parameter into an expression</title><link>https://community.appian.com/thread/92396?ContentTypeID=1</link><pubDate>Thu, 17 Mar 2022 20:46:32 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:8cc86a11-e241-487a-bb78-2ae08bc23048</guid><dc:creator>nicholaso0002</dc:creator><description>&lt;p&gt;Please, can you show me a sample of how to do that?&lt;/p&gt;
&lt;p&gt;Thanks&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How do you pass process variable parameter into an expression</title><link>https://community.appian.com/thread/92395?ContentTypeID=1</link><pubDate>Thu, 17 Mar 2022 20:42:35 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:0d8bbb52-1c73-4460-bc4b-e467c1eeb4ba</guid><dc:creator>Mike Schmitt</dc:creator><description>&lt;p&gt;I&amp;#39;m glad to hear you got the surrounding syntax issues worked out.&amp;nbsp; Though I was getting at something else with my comment here.&lt;/p&gt;
&lt;p&gt;I guess my point here was that if you&amp;#39;re calling the same stored procedure in the same way twice, just to check whether it returns empty, then what you should be doing is calling it just once, setting that value into a local variable, and then check that variable to see if it&amp;#39;s empty.&amp;nbsp; There&amp;#39;s no reason to call it twice when you only need to call it once.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How do you pass process variable parameter into an expression</title><link>https://community.appian.com/thread/92394?ContentTypeID=1</link><pubDate>Thu, 17 Mar 2022 20:03:41 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:1d58cbbf-11f6-4011-aba8-7f1be4108086</guid><dc:creator>nicholaso0002</dc:creator><description>&lt;p&gt;it&amp;#39;s calling the same date. This issue is now resolved. I noticed that the previous expression calling the stored proc needed the fv!items.xxxx to match the xxxx in the current expression. It was a case sensitivity issue. caseid != caseId.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How do you pass process variable parameter into an expression</title><link>https://community.appian.com/thread/92393?ContentTypeID=1</link><pubDate>Thu, 17 Mar 2022 19:55:13 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:8893afec-17c8-4263-94eb-c7320f1e4476</guid><dc:creator>Mike Schmitt</dc:creator><description>&lt;p&gt;Is it being called on a different date in the two different spots?&amp;nbsp; I couldn&amp;#39;t tell as your original screenshots cuts off what value is actually passed in.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How do you pass process variable parameter into an expression</title><link>https://community.appian.com/thread/92392?ContentTypeID=1</link><pubDate>Thu, 17 Mar 2022 19:06:25 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:e71c5762-8185-4a93-b46c-2e98afd9fcc0</guid><dc:creator>nicholaso0002</dc:creator><description>&lt;p&gt;Yes, the first checks whether it has empty value.&lt;/p&gt;
&lt;p&gt;The second executes if the value is not empty.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How do you pass process variable parameter into an expression</title><link>https://community.appian.com/thread/92391?ContentTypeID=1</link><pubDate>Thu, 17 Mar 2022 19:04:13 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:b8e00f45-1417-4fcf-9942-569830e3a1f1</guid><dc:creator>Mike Schmitt</dc:creator><description>&lt;p&gt;Why are you calling your Stored Procedure rule twice just to check whether it returns an empty value?&lt;br /&gt;&lt;img height="101" src="/resized-image/__size/320x240/__key/communityserver-discussions-components-files/16/pastedimage1647543843156v1.png" width="385" alt=" " /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How do you pass process variable parameter into an expression</title><link>https://community.appian.com/thread/92390?ContentTypeID=1</link><pubDate>Thu, 17 Mar 2022 18:57:22 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:047a12bf-9b63-49b8-a9f1-db44f50df843</guid><dc:creator>nicholaso0002</dc:creator><description>&lt;p&gt;&lt;img alt=" " src="/resized-image/__size/320x240/__key/communityserver-discussions-components-files/16/2022_2D00_03_2D00_17_5F00_13_2D00_54_2D00_03.png" /&gt;&lt;/p&gt;
&lt;p&gt;this expression is not returning value. But the stored proc has values.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How do you pass process variable parameter into an expression</title><link>https://community.appian.com/thread/92345?ContentTypeID=1</link><pubDate>Thu, 17 Mar 2022 05:23:13 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:b1d05d3e-8318-4a22-a947-83e3f037b607</guid><dc:creator>Harshit Bumb (Appyzie)</dc:creator><description>&lt;p&gt;Hi there,&lt;/p&gt;
&lt;p&gt;All the domains are not accessible everywhere in Appian. For ex. you can only use pv! domain in a process model. Therefore, to check which all domains can be used, check for the domains icon on the toolbar of the corresponding expression editor.&amp;nbsp;&lt;br /&gt;Like the other commenter mentioned, you will have to pass that value inside the ER using an RI.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How do you pass process variable parameter into an expression</title><link>https://community.appian.com/thread/92342?ContentTypeID=1</link><pubDate>Thu, 17 Mar 2022 02:39:46 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:7819ff0c-807d-41a7-843a-88eec608d8c8</guid><dc:creator>GopalK</dc:creator><description>&lt;p&gt;Hi , create a rule input in your expression rule. Once you use this expression in a process model then pass the process variable into it. For example if you have a rule called &amp;quot;getEmployeeDetails&amp;quot; and you have rule input &amp;quot;employeeId&amp;quot; in it. Then , when you call this rule in process model ,it should look like below,&lt;/p&gt;
&lt;p&gt;rule!getEmployeeDetails (employeeId:pv!employeeId).&lt;/p&gt;
&lt;p&gt;So in your case , create a rule input of &amp;quot;paymentDate&amp;quot; and then, once you call it in process model pass the process variable.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>