<?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>Using local variables in a rule that is used in reduce function from UI</title><link>https://community.appian.com/discussions/f/general/23624/using-local-variables-in-a-rule-that-is-used-in-reduce-function-from-ui</link><description>Hi, 
 Is there a way to use local variables in a rule that is used in reduce function When called from UI? 
 When Using from UI it says that I need to configure refreahalways for the local variable ..... 
 Thaks in advance, 
 Gil</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: Using local variables in a rule that is used in reduce function from UI</title><link>https://community.appian.com/thread/90622?ContentTypeID=1</link><pubDate>Thu, 03 Feb 2022 14:01:25 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:ab7902db-168b-42a6-8327-eebc22780dea</guid><dc:creator>giltab</dc:creator><description>&lt;p&gt;Thanks very much,&lt;/p&gt;
&lt;p&gt;It&amp;#39;s working.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Using local variables in a rule that is used in reduce function from UI</title><link>https://community.appian.com/thread/90614?ContentTypeID=1</link><pubDate>Thu, 03 Feb 2022 12:18:54 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:77ad09dc-dfb9-4ab3-a75e-77a46577c40e</guid><dc:creator>giltab</dc:creator><description>&lt;p&gt;Thanks Stefan!&lt;/p&gt;
&lt;p&gt;I will try what is written there&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Using local variables in a rule that is used in reduce function from UI</title><link>https://community.appian.com/thread/90606?ContentTypeID=1</link><pubDate>Thu, 03 Feb 2022 11:48:33 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:3c77f7bf-fa0f-427f-8152-d979a4611246</guid><dc:creator>Stefan Helzle</dc:creator><description>&lt;p&gt;Your predicate expression has local variables. Update these similar to that example.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://docs.appian.com/suite/help/21.4/Local_Variables.html#refresh-always"&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: Using local variables in a rule that is used in reduce function from UI</title><link>https://community.appian.com/thread/90601?ContentTypeID=1</link><pubDate>Thu, 03 Feb 2022 11:32:59 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:0e07a0fe-485c-4f75-a033-7a948b7acbd5</guid><dc:creator>giltab</dc:creator><description>&lt;p&gt;Hi Richard,&lt;/p&gt;
&lt;p&gt;I am doing Shpitzer clearing schedule.&lt;/p&gt;
&lt;p&gt;For that I need to use values from previous iterations.&lt;/p&gt;
&lt;p&gt;To my understanding the only way to get results from previous iteration is with reduce.&lt;/p&gt;
&lt;p&gt;It works by the way - I just wasnt able to use local variables which made me repeat calculations...&lt;/p&gt;
&lt;p&gt;Thanks,&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Using local variables in a rule that is used in reduce function from UI</title><link>https://community.appian.com/thread/90599?ContentTypeID=1</link><pubDate>Thu, 03 Feb 2022 11:21:02 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:31a1b066-5d4b-4115-acab-097ba4a8cf85</guid><dc:creator>giltab</dc:creator><description>&lt;p&gt;Thanks Stefan!&lt;/p&gt;
&lt;p&gt;Can you give an example? just how to declare the&amp;nbsp;&lt;span&gt;a!refreshVariable in the right context ?&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Thanks&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Using local variables in a rule that is used in reduce function from UI</title><link>https://community.appian.com/thread/90597?ContentTypeID=1</link><pubDate>Thu, 03 Feb 2022 09:45:52 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:e3b82892-7fbd-4201-b233-52d4ff3e9bbf</guid><dc:creator>Stefan Helzle</dc:creator><description>&lt;p&gt;That&amp;#39;s pretty simple. a!localVariables does not re-evaluate local variables by default when used inside reduce(). To make this work, you need to declare the value of the local using a!refreshVariable and set refreshAlways to true.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Using local variables in a rule that is used in reduce function from UI</title><link>https://community.appian.com/thread/90596?ContentTypeID=1</link><pubDate>Thu, 03 Feb 2022 09:43:37 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:c3add40a-7c0c-46b8-8c89-b0d85cfaf80e</guid><dc:creator>Richard Michaelis</dc:creator><description>&lt;p&gt;the information is pretty limited. can you tell as about your overall use case?&amp;nbsp;&lt;br /&gt;perhaps reduce() is not the right fit :)&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>